-
Notifications
You must be signed in to change notification settings - Fork 3
/
stopMomentumBasedFlight.m
47 lines (38 loc) · 1.22 KB
/
stopMomentumBasedFlight.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
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RUN THIS SCRIPT TO REMOVE LOCAL PATHS ADDED WHEN RUNNING THE CONTROLLER.
%
% In the Simulink model, this script is run every time the user presses
% the terminate button.
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% close the native control GUI (if present) and reset the GUI input to zero
try
close(ironcubControlGui);
set_param('momentumBasedFlight/FLIGHT CONTROLLER (CORE) V3.0/Input_GUI','Value','0')
catch ME
warning(ME.message)
end
try
close(flightGui);
catch ME
warning(ME.message)
end
% remove local paths
rmpath(genpath('./src/'))
rmpath('../controlAndDataGui/');
rmpath(genpath('../matlab-functions-lib/'));
% Try to remove chache files and folders
try
rmdir('./slprj','s')
delete('momentumBasedFlight.slxc')
catch ME
warning(ME.message)
end
% Create a folder for collecting data
if Config.SAVE_WORKSPACE
if (~exist(['experiments',date],'dir'))
mkdir(['experiments',date]);
end
matFileList = dir(['./experiments',date,'/*.mat']);
c = clock;
save(['./experiments',date,'/exp_',num2str(c(4)),'-',num2str(c(5)),'.mat'])
end