Skip to content

Commit bdbf7fd

Browse files
author
Gabriele
committed
updated GUI (#82) and print warning when joints have spikes or exit range (#81)
1 parent 30c4003 commit bdbf7fd

22 files changed

+5258
-2952
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ slprj/
3131
*.mat
3232

3333
# Matlab figures
34-
*.fig
34+
*.fig
35+
!/library/matlab-gui/simulinkStaticGUI.fig
3536

3637
# Simulink autosave
3738
*.autosave

controllers/fixed-base-joints-torque-control/jointsControl.mdl

+434-190
Large diffs are not rendered by default.

controllers/fixed-base-joints-torque-control/stopJointsControl.m

+34-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,37 @@
5656

5757
warning(['The time step tolerance of ', num2str(Config.tStep), '[s] has been violated more than 50 times.'])
5858
end
59-
end
59+
end
60+
61+
% If a joint hits the limits or an encoder spike is detected, print a
62+
% warning message displaying the name of the joint
63+
if Config.EMERGENCY_STOP_WITH_ENCODER_SPIKES && exist('res_check_spikes','var')
64+
65+
if ~isempty(res_check_spikes.signals.values)
66+
67+
checkEachJoint = res_check_spikes.signals.values(end,:);
68+
69+
for k = 1:length(checkEachJoint)
70+
71+
if checkEachJoint(k)
72+
73+
warning(['A spike occurred on joint ', WBTConfigRobot.ControlledJoints{k}])
74+
end
75+
end
76+
end
77+
end
78+
if Config.EMERGENCY_STOP_WITH_JOINTS_LIMITS && exist('res_check_range','var')
79+
80+
if ~isempty(res_check_range.signals.values)
81+
82+
checkEachJoint = res_check_range.signals.values(end,:);
83+
84+
for k = 1:length(checkEachJoint)
85+
86+
if checkEachJoint(k)
87+
88+
warning(['Joint ', WBTConfigRobot.ControlledJoints{k}, ' exited the range'])
89+
end
90+
end
91+
end
92+
end

0 commit comments

Comments
 (0)