Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README (after #122) #126

Merged
merged 4 commits into from
May 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Converted floating-base-balancing-torque-control-with-simulator into …
…a package +floatingBaseBalancingTorqueControlWithSimulator

This avoids to:
- Add the model parent folder path to the Matlab path, as well as for every new model (example) installed.
  It would quickly become a mess with the installation of multiple examples, with problems of file names
  collision.
- Having 'folder1/folder2/model.mdl' and 'folder1' in the Matlab path wouldn't work well either because we
  wouldn't be able to call 'folder2/model.mdl' for opening the model from anywhere.
- From there, the easiest solution is to use namespaces provided by Matlab packages.
  • Loading branch information
nunoguedelha committed May 11, 2021
commit 85aefc53668639f3073fb287db18cc373f547a1f
Original file line number Diff line number Diff line change
@@ -21,8 +21,11 @@
clearvars -except sl_synch_handles simulinkStaticGUI
clc

% Get the parent folder of the running *.mdl model
MODEL_PATH = fileparts(which(bdroot));

% Add path to local source code
addpath('./src/')
addpath(strcat(MODEL_PATH,'/src/'));

%% GENERAL SIMULATION INFO
%
@@ -75,10 +78,10 @@
otherwise
error(['Unsupported robot model. Supported models are listed below:',repmat('\n- %s',[1 numel(supportedMmodels)])],supportedMmodels{:});
end
run(strcat('app/robots/',getenv('YARP_ROBOT_NAME'),'/configRobot.m'));
run(strcat('app/robots/',getenv('YARP_ROBOT_NAME'),'/configStateMachine.m'));
run(strcat('app/robots/',getenv('YARP_ROBOT_NAME'),'/gainsAndReferences.m'));
run(strcat('app/robots/',getenv('YARP_ROBOT_NAME'),'/configRobotSim.m'));
run(strcat(MODEL_PATH,'/app/robots/',getenv('YARP_ROBOT_NAME'),'/configRobot.m'));
run(strcat(MODEL_PATH,'/app/robots/',getenv('YARP_ROBOT_NAME'),'/configStateMachine.m'));
run(strcat(MODEL_PATH,'/app/robots/',getenv('YARP_ROBOT_NAME'),'/gainsAndReferences.m'));
run(strcat(MODEL_PATH,'/app/robots/',getenv('YARP_ROBOT_NAME'),'/configRobotSim.m'));
run('initVisualizer');

% Deactivate/activate the internal coordinator
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ Model {
NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
ComputedModelVersion "3.128"
ComputedModelVersion "3.131"
NumModelReferences 0
NumTestPointedSignals 0
NumProvidedFunctions 0
@@ -357,21 +357,22 @@ Model {
FPTRunName "Run 1"
MaxMDLFileLineLength 120
CloseFcn "%% Try to close the GUI (the user might have already closed it)\ntry\n\n close(simulinkStaticGUI)\n\nend"
InitFcn "%% initialize the simulation\ncd(fileparts(which(bdroot)));\ninitTorqueControlBalancingWithSimu;\n\n%% T"
"ry to edit the GUI (the user may have already closed it)\ntry\n\n %% Update Start Button\n set(sl_synch_handle"
"s.startButton,'Backgroundcolor',[0.0,1.0,0.0]);\n set(sl_synch_handles.startButton,'Enable','on');\n\nend"
InitFcn "%% initialize the simulation\nfloatingBaseBalancingTorqueControlWithSimulator.initTorqueControlBalancing"
"WithSimu;\n\n%% Try to edit the GUI (the user may have already closed it)\ntry\n\n %% Update Start Button\n se"
"t(sl_synch_handles.startButton,'Backgroundcolor',[0.0,1.0,0.0]);\n set(sl_synch_handles.startButton,'Enable','on'"
");\n\nend"
StartFcn "%% Try to edit the GUI (the user may have already closed it)\ntry\n\n %% Update Start Button\n se"
"t(sl_synch_handles.startButton,'Backgroundcolor',[0.8,0.8,0.8]);\n set(sl_synch_handles.startButton,'Enable','off"
"');\n\n %% Update Compile Button\n set(sl_synch_handles.compileButton,'Backgroundcolor',[0.8,0.8,0.8]);\n s"
"et(sl_synch_handles.compileButton,'Enable','off');\n\n %% Update Exit Button\n set(sl_synch_handles.exitButton"
",'Backgroundcolor',[0.8,0.8,0.8]);\n set(sl_synch_handles.exitButton,'Enable','off');\n\nend\n\n"
StopFcn "%% stop the simulation\ncd(fileparts(which(bdroot)));\nstopTorqueControlBalancingWithSimu;\n\n%% Try to "
"edit the GUI (the user may have already closed it)\ntry\n\n %% Update Start Button\n if get(sl_synch_handles.c"
"heckbox_recompile, 'Value') \n set(sl_synch_handles.startButton,'Backgroundcolor',[0.0,1.0,0.0]);\n s"
"et(sl_synch_handles.startButton,'Enable','on');\n end\n\n %% Update Compile Button\n set(sl_synch_handles.c"
"ompileButton,'Backgroundcolor',[1.0,0.6,0.0]);\n set(sl_synch_handles.compileButton,'Enable','on');\n\n %% Upd"
"ate Exit Button\n set(sl_synch_handles.exitButton,'Backgroundcolor',[0.0,1.0,1.0]);\n set(sl_synch_handles.exi"
"tButton,'Enable','on');\n\nend\n\n\n"
StopFcn "%% stop the simulation\nfloatingBaseBalancingTorqueControlWithSimulator.stopTorqueControlBalancingWithSi"
"mu;\n\n%% Try to edit the GUI (the user may have already closed it)\ntry\n\n %% Update Start Button\n if get(s"
"l_synch_handles.checkbox_recompile, 'Value') \n set(sl_synch_handles.startButton,'Backgroundcolor',[0.0,1.0,"
"0.0]);\n set(sl_synch_handles.startButton,'Enable','on');\n end\n\n %% Update Compile Button\n set(s"
"l_synch_handles.compileButton,'Backgroundcolor',[1.0,0.6,0.0]);\n set(sl_synch_handles.compileButton,'Enable','on"
"');\n\n %% Update Exit Button\n set(sl_synch_handles.exitButton,'Backgroundcolor',[0.0,1.0,1.0]);\n set(sl_"
"synch_handles.exitButton,'Enable','on');\n\nend\n\n\n"
LastSavedArchitecture "maci64"
Object {
$PropName "BdWindowsInfo"
@@ -410,42 +411,42 @@ Model {
ViewObjType "SimulinkTopLevel"
LoadSaveID "0"
Extents [2171.0, 1188.0]
ZoomFactor [2.3728780194018966]
Offset [713.97347178327891, 185.09791008523257]
SceneRectInView [713.97347178327891, 185.09791008523257, 914.92271505267615, 500.65784683674769]
ZoomFactor [2.372878019401897]
Offset [714.07882907428, 185.18910568892798]
SceneRectInView [714.07882907428, 185.18910568892798, 914.922715052676, 500.65784683674764]
}
Object {
$ObjectID 6
IsActive [0]
IsTabbed [0]
ViewObjType "SimulinkSubsys"
LoadSaveID "5014"
LoadSaveID "4955"
Extents [2171.0, 1188.0]
ZoomFactor [2.03]
Offset [-310.81869612068976, -180.61083743842369]
SceneRectInView [-310.81869612068976, -180.61083743842369, 1069.4581280788179, 585.22167487684737]
ZoomFactor [2.0773052223433903]
Offset [-119.91137569995328, 23.052613159122757]
SceneRectInView [-119.91137569995328, 23.052613159122757, 1045.1040013999066, 571.89477368175449]
}
Object {
$ObjectID 7
IsActive [0]
IsTabbed [0]
ViewObjType "SimulinkSubsys"
LoadSaveID "4938"
LoadSaveID "5014"
Extents [2171.0, 1188.0]
ZoomFactor [2.9013369436452869]
Offset [-326.36442414255714, -208.23320111992533]
SceneRectInView [-326.36442414255714, -208.23320111992533, 748.27572328511428, 409.46640223985065]
ZoomFactor [2.03]
Offset [-310.81869612068976, -180.61083743842369]
SceneRectInView [-310.81869612068976, -180.61083743842369, 1069.4581280788179, 585.22167487684737]
}
Object {
$ObjectID 8
IsActive [0]
IsTabbed [0]
ViewObjType "SimulinkSubsys"
LoadSaveID "4955"
LoadSaveID "4938"
Extents [2171.0, 1188.0]
ZoomFactor [2.0773052223433903]
Offset [-119.91137569995328, 23.052613159122757]
SceneRectInView [-119.91137569995328, 23.052613159122757, 1045.1040013999066, 571.89477368175449]
ZoomFactor [2.9013369436452869]
Offset [-326.36442414255714, -208.23320111992533]
SceneRectInView [-326.36442414255714, -208.23320111992533, 748.27572328511428, 409.46640223985065]
}
Object {
$ObjectID 9
@@ -1323,39 +1324,39 @@ Model {
Dimension 3
Object {
$ObjectID 88
Type "Simulink:Editor:ReferencedFiles"
ID "Referenced Files"
Type "GLUE2:PropertyInspector"
ID "Property Inspector"
Visible [0]
CreateCallback ""
UserData "{\"filterShowRefModels\":\"true\",\"filterShowRefSubs\":\"true\",\"filterShowOnlyDirtyFiles\":\"false\"}\n"
UserData ""
Floating [0]
DockPosition "Left"
DockPosition "Right"
Width [640]
Height [480]
Minimized "Unset"
}
Object {
$ObjectID 89
Type "GLUE2:PropertyInspector"
ID "Property Inspector"
Type "GLUE2:SpreadSheet"
ID "ModelData"
Visible [0]
CreateCallback ""
CreateCallback "DataView.createSpreadSheetComponent"
UserData ""
Floating [0]
DockPosition "Right"
DockPosition "Bottom"
Width [640]
Height [480]
Minimized "Unset"
}
Object {
$ObjectID 90
Type "GLUE2:SpreadSheet"
ID "ModelData"
Type "Simulink:Editor:ReferencedFiles"
ID "Referenced Files"
Visible [0]
CreateCallback "DataView.createSpreadSheetComponent"
UserData ""
CreateCallback ""
UserData "{\"filterShowRefModels\":\"true\",\"filterShowRefSubs\":\"true\",\"filterShowOnlyDirtyFiles\":\"false\"}\n"
Floating [0]
DockPosition "Bottom"
DockPosition "Left"
Width [640]
Height [480]
Minimized "Unset"
@@ -1388,9 +1389,9 @@ Model {
ModifiedByFormat "%<Auto>"
LastModifiedBy "nunoguedelha"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Tue May 11 06:00:44 2021"
RTWModifiedTimeStamp 542613638
ModelVersionFormat "%<AutoIncrement:3.128>"
LastModifiedDate "Tue May 11 08:23:07 2021"
RTWModifiedTimeStamp 542621747
ModelVersionFormat "%<AutoIncrement:3.131>"
SampleTimeColors on
SampleTimeAnnotations on
LibraryLinkDisplay "disabled"
@@ -2770,6 +2771,12 @@ Model {
ContentPreviewEnabled off
ConfigSource "Workspace"
ConfigObject "'WBTConfigRobot'"
RobotName "'icubSim'"
UrdfFile "'model.urdf'"
ControlledJoints "{'l_elbow','l_shoulder_pitch','torso_roll'}"
ControlBoardsNames "{'left_arm','right_arm','torso'}"
LocalName "'WBT'"
GravityVector "[0,0,-9.81]"
}
Block {
BlockType Constant
@@ -2784,7 +2791,8 @@ Model {
$ClassName "Simulink.Mask"
Type "Fixed neck position"
Description "we assume that the neck position is fixed (\"lumped\" head and torso) in the [0 0 0] position."
Display "image('images/initNeckPosBlock.jpeg'); % Use \"Edit Image\" on toolstrip to change."
Display "image(strcat(fileparts(which(bdroot)),'/images/initNeckPosBlock.jpeg')); % Use \"Edit Image\" on toolstrip"
" to change.\n"
RunInitForIconRedraw "off"
Object {
$PropName "DialogControls"
@@ -19102,6 +19110,12 @@ Model {
ContentPreviewEnabled on
ConfigSource "Workspace"
ConfigObject "'WBTConfigRobotSim'"
RobotName "'icubSim'"
UrdfFile "'model.urdf'"
ControlledJoints "{'l_elbow','l_shoulder_pitch','torso_roll'}"
ControlBoardsNames "{'left_arm','right_arm','torso'}"
LocalName "'WBT'"
GravityVector "[0,0,-9.81]"
}
Block {
BlockType Constant
@@ -20506,9 +20520,6 @@ Stateflow {
screen [1 1 3600 1200 1.180555555555556]
treeNode [0 37 0 0]
viewObj 36
visible 1
subviewS {
}
ssIdHighWaterMark 7
decomposition CLUSTER_CHART
type EML_CHART