AVDS-Matlab Toolbox

CONNECTING TO AVDS FROM MATLAB
There are three connection types available between AVDS and 
MATLAB. They are they are through interactive simulation, data 
playback and network connection. All three of these connections 
types are implemented in the AVDS-Matlab Toolbox. This toolbox
contains both Matlab functions and Simulink blocks.

The choice of the connection type depends on the type of simulation.
If the simulation runs in near real-time, but needs to run on a separate 
computer from AVDS, or there are multiple vehicles in the simulation,
then use the network connection functions. If the simulation does 
not run in near real-time then use the functions that save data for use
in AVDS playback mode. This includes those simulations with multiple 
vehicles. To run a simulation in near real-time with user inputs, use the 
interactive simulation functions.

FOR MORE INFORMATION, SEE THE "AVDS-MatlabToolbox Reference Manual".

INSTALLATION
To install the AVDS-Matlab Toolbox follow these steps:

1) Start Matlab and change to the "toolbox" directory. For example: 
   cd 'C:\Program Files\AVDS\Utilities\MATLABToolbox\toolbox'

2) Run the install.m script. The command is:
   install 

NOTE: The next two steps are necessary only for versions of AVDS that were 
distributed without the AVDS-Matlab toolbox. For more information see the file:
	MATLABToolbox\Toolbox\RequiredAVDSFiles\ReadMe.RequiredAVDSFiles.txt

3) Copy the files in the "MATLABToolbox\toolbox\RequiredAVDSFiles\model"
   and "MATLABToolbox\toolbox\RequiredAVDSFiles\userfiles" directories
   into "AVDS\model" and "AVDS\userfiles" directories.

4) Edit the file "AVDS\model\modelcap.txt" to add the neames of the model
   files, i.e. add the lines:
      MATLAB_AC.dll
      MATLAB_FCS.dll


This will make the functions and blocks of the AVDS-Matlab Toolbox
available in the Matlab path. The AVDS-Matlab Toolbox Simulink blocks
will be available through the Simulink Library Browser.


EXAMPLES
In the directory "MATLABToolbox\Examples" there are subdirectories that
contain examples of the use of all of the functions and blocks in the 
AVDS-Matlab Toolbox.

Network Examples -
The "NetworkExample" directory contains a Matlab function, "ExampleSend.m"
that demonstrates sending packets for multiple vehicles from Matlab to 
AVDS. The function "ExampleReceive.m" demonstrates receiving packets in
Matlab from AVDS. For Simulink, the directory contains the model 
"NetworkSendExample.mdl" That demonstrates sending AVDS packets for
multiple vehicles. Both the Matlab and Simulink examples syncronize
the vehicle models to near real-time using the timing functions from the
toolbox.

Playback Examples -
The "PlaybackExample" directory contains a Matlab example, "SampleAVDSPlayback.m",
and a Simulink model example, "PlaybackExample.mdl", that demonstrate saving data 
for AVDS Playback for multiple vehicles. 

Interactive Simulation Examples -
The "SimulationExample" directory contains four examples that demonstrate 
near real-time interacive simlation using Matlab/Simulink and AVDS. There are 
examples of implementing a flight control system in Matlab, 
"AVDS_FCS_Matlab.m", and in Simulink, "ExampleFCS.mdl", with the aircraft 
model running in AVDS. Also contained in the directory are examples of running 
the vehicle model in Matlab, "AVDS_AC_Matlab.m", and Simulink, "ExampleAC.mdl", 
with the FCS model in AVDS.


SOURCE CODE
The directory "MATLABToolbox\toolbox\SourceCode" contains subdirectories
that contain Microsoft Visual C++ Version 6.0 projects that were used to
build the AVDS-Matlab Toolbox functions. These directories also contain
make files that can be used to build the functions.
