forked from robotology/whole-body-controllers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
startModelWithStaticGui.m
29 lines (20 loc) · 1.02 KB
/
startModelWithStaticGui.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
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RUN THIS SCRIPT TO USE SIMULINK WITH THE STATIC SIMULINK GUI
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear variables
clc
% add the path to the static gui and to some utility functions
addpath('../../library/matlab-gui');
addpath('./src-static-gui');
disp('[startModel]: loading the model...')
% open the model
open_system('torqueControlBalancing.mdl','loadonly');
% add message to tell the user that the model has been opened correctly
disp('[startModel]: model loaded correctly')
disp('[startModel]: the "Start Model" button is enabled only after compiling the model.')
% add warning to warn the user NOT to close the GUI
warning('DO NOT CLOSE the GUI. The model won''t be closed! Use "Exit Model" button instead.')
% check if the GUI is correctly opened
if ~exist('sl_synch_handles', 'var')
error('The GUI did not load correctly, or it is already opened. Close the GUI, run "closeModel.m" or restart Matlab')
end