-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTROPIC_add_path.m
43 lines (30 loc) · 1.03 KB
/
TROPIC_add_path.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function TROPIC_add_path()
% TROPIC_add_path: add required path to CasADi
% - must run this from /TROPIC root at least once
% - configured for CasADi v3.5.1 (released October 2019)
% make sure it's running from root (/TROPIC)
cur = fullfile(pwd);
addpath(fullfile(cur));
% available on Mac, Linux, and Windows
if ismac
% Code to run on Mac platform
addpath(fullfile(cur, 'casadi', 'casadi-osx-matlabR2015a-v3.5.1'));
elseif isunix
% Code to run on Linux platform
addpath(fullfile(cur, 'casadi', 'casadi-linux-matlabR2014b-v3.5.1'));
elseif ispc
% Code to run on Windows platform
addpath(fullfile(cur, 'casadi', 'casadi-windows-matlabR2016a-v3'));
else
error('Platform not supported');
end
import casadi.*
% required functions
addpath(fullfile(cur, 'dynamics'));
% add spatial vector algebra suite
addpath(fullfile(cur, 'dynamics', 'spatial_v2'));
% add path to optimization functions
addpath(fullfile(cur, 'optimization'));
% make sure the machine is set up with valid C compiler
mex -setup C
end