-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpath_set.m
65 lines (52 loc) · 2.2 KB
/
path_set.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
clear all; close all; clc;
% Set paths needed by project
% Get current folder dir
projectRootDir = fileparts(mfilename('fullpath'));
% Specify necessary folders
includePaths = { ...
projectRootDir; ...
genpath(fullfile(projectRootDir, '00_utilities')); ...
genpath(fullfile(projectRootDir, '01_model')); ...
genpath(fullfile(projectRootDir, '02_simulation')); ...
genpath(fullfile(projectRootDir, '03_formulation')); ...
genpath(fullfile(projectRootDir, '05_example')); ...
fullfile(projectRootDir, '06_build'); ...
genpath(fullfile(projectRootDir, '06_build','acadosBuild')); ...
fullfile(projectRootDir, '06_build','s_functions'); ...
fullfile(projectRootDir, '06_build','s_functions','Simulation'); ...
fullfile(projectRootDir, '06_build','s_functions','ECO'); ...
fullfile(projectRootDir, '06_build','s_functions','ECO','c_generated_code'); ...
};
% Add specified folders to Matlab path
for ii = 1:size(includePaths,1)
addpath(includePaths{ii});
end
% get path of external software packages
run path_usr.m
% include casadi folder
addpath(genpath(fullfile(casadiPath)))
% Include acados folders
addpath(fullfile(acadosPath,'interfaces','acados_matlab_octave'));
addpath(fullfile(acadosPath,'interfaces','acados_matlab_octave','acados_template_mex'));
% Set Environment Variables
env.acadosDir.name = 'ACADOS_INSTALL_DIR';
env.acadosDir.val = fullfile(projectRootDir,'04_external','acados');
env.acadosRun.name = 'ENV_RUN';
env.acadosRun.val = 'true';
envNames = fieldnames(env);
for ii = 1:numel(envNames)
setenv(env.(envNames{ii}).name,...
env.(envNames{ii}).val);
end
% Set work directory for compiled and temporary data
workFolder = includePaths{end};
Simulink.fileGenControl('set', 'CacheFolder', workFolder, 'CodeGenFolder', workFolder);
save(fullfile(workFolder, 'includePaths.mat'), 'includePaths');
clear workFolder ii includePaths pathCell onPath usrPaths path_cantera path_casadi path_qpOASES
% Set default settings
set(groot,'defaulttextinterpreter','latex')
set(groot,'defaultlegendinterpreter','latex')
set(groot,'DefaultTextarrowshapeInterpreter','latex')
set(groot,'defaultAxesTickLabelInterpreter','latex');
% set default colors
run RWTH_Colors.m