MTSOS: download and install

To use MTSOS, download and extract MTSOS from one of the two formats below.

MTSOS.zip

MTSOS.tar.gz

MATLAB

To compile MTSOS in MATLAB, simply run the script setup_MTSOS.m. If MATLAB is configured to compile mex files, this will produce MTSOS_mat.mex (where the suffix is system dependent). If MATLAB is not configured to compile mex files, modifications may be needed to mexopts.sh. More information can found on the Mathworks site.

If everything compiles smoothly, setup_MTSOS.m will also run test_MTSOS.m. This will run a simple test and will generate a figure like the ones in Minimum-Time Speed Optimization Along a Fixed Path, showing a path and the resultant vehicle trajectory achieved by applying the found inputs. Along with a figure, a successful run will print:

The optimal time to traverse is 8.3287
MTSOS is working!
running simulation of control inputs

If the user has written barrier and dynamics functions as described later, the user will need to replace barrier_front.c and dynamics_front.c with those functions in setup_MTSOS.m. The dynamics and barrier functions provided are for the front wheel drive model presented in Minimum-Time Speed Optimizaiton Along a Fixed Path.

Independent of MATLAB

MTSOS requires the BLAS (Basic Linear Algebra Subroutines) library to run; the modifications necessary are all related to linking this library. Assuming all linking is performed correctly, MTSOS can be compiled by typing make in the MTSOS directory. This will produce the executable test_MTSOS. MTSOS can also be compiled with make test which will both build and execute test_MTSOS. Assuming all linking is handled properly it will produce the result

$make test
gcc -c test_MTSOS.c
gcc -c barrier_front.c
gcc -c dynamics_front.c
gcc -c MTSOS.c
gcc -c csparse.c
gcc -framework Accelerate MTSOS.o csparse.o barrier_front.o dynamics_front.o test_MTSOS.o -o test_MTSOS
./test_MTSOS
Running test for MTSOS.
the optimal time to traverse is 8.3287.
the time to compute is 64.415000 milliseconds.
MTSOS is working!

Note that the BLAS interface is not completely standardized, so if problems arise, it could be due to discrepencies in the BLAS interfaces. MTSOS assumes the BLAS interface described in BLAS tips, which is used by MATLAB and OSX, but not the same one produced by ATLAS. Should the user have a different BLAS interface, manual changes must be made to the calls to dgemv in MTSOS.c and, to run test_MTSOS, to dsyr in barrier_front.c.

Mac

For most OSX systems (post v10.3 Panther), the Makefile as included should be sufficient to compile MTSOS; simply type make on the command line inside the MTSOS directory. On most recent OSX systems, the BLAS libraries are included using the -framework Accelerate command when linking and including the #include <Accelerate/Accelerate.h> line in MTSOS.h. This is the default setup for the package.

Windows/Linux

Windows or Linux users must modify the MTSOS.h file replacing the call to #include <Accelerate/Accelerate.h> with the location of their BLAS library, removing the -framework Accelerate tag from the makefile, and linking to their BLAS library. If the system does not have a BLAS library one can be created using ATLAS, although be warned that the BLAS interface may be slightly different and therefore cause unexpected behavior