robotarium / robotarium-matlab-simulator

MATLAB simulator for the Robotarium!
MIT License
95 stars 53 forks source link

Possibly required MATLAB toolbox: Optimization #8

Open dr-parker opened 7 years ago

dr-parker commented 7 years ago

The use of the function quadprog from MATLAB's Optimization toolbox may be necessary when executing the following lines from create_uni_barrier_certificate.m or create_si_barrier_certificate.m

opts = optimoptions(@quadprog,'Display','off');

and

vnew = quadprog(H, double(f), A, b, [],[], [], [], [], opts);

An alternative function to generate vnew should contribute to making the code backwards compatible with older versions of MATLAB.

NOTE: I have only tested the Optimization toolbox that comes with MATLAB R2013a with the Robotarium code successfully, therefore, older versions of the Optimization toolbox may require a different use of quadprog. A potential open-source alternative option is found here with information about its usage here. After registering with this third-party site, you may download the available package, move the unzipped directory to your local /robotarium-matlab-simulator directory, and replace the line (as found in /utilities/barrier_certificates/create_si_barrier_certificate.m and /utilities/barrier_certificates/create_uni_barrier_certificate):

vnew = quadprog(H, double(f), A, b, [], [], [], [], [], opts); % For newer versions of MATLAB

With

vnew = qps_as(H,double(f),[],[],0); % As tested for versions of MATLAB R2012a and older

Also, be sure to comment out the following line from each of the aforementioned files:

opts = optimoptions(@quadprog,'Display','off'); 

The functions qpas, qpip, or qps_ip may also be used instead of qps_as. Also, only qps_as and qps_ip produced the smoothest navigation output, yet, the exclusion of A and b as input to these two function calls leaves the vehicles ignoring the pre-defined safety_radius. Finally, using qps_mq caused my instance of MATLAB to shutdown, so consider avoiding that function call.