1 function plotYDotDivided2(rootPath, robotName, ydotName)
8 yDotstr = strcat( '/', ydotName, '.txt');
9 yDot = importMatrices(strcat(rootPath, robotName, yDotstr));
10 if strcmp(ydotName, "yDotFinalWithCollision")
11 yDotNoCol = importMatrices(strcat(rootPath, robotName, "/yDotFinal.txt"));
12 yDot = yDot - yDotNoCol;
15 nStep = size(yDot, 3);
17 %millisecond indicated in missionManager
19 totSecondPassed = sControlLoop*(nStep-1);
20 seconds = 0:sControlLoop:totSecondPassed;
25 figure('Renderer', 'painters', 'Position', [0 0 750 990])
26 %% plot joint commands
34 plot([secInsertion; secInsertion], [-0.06,0.03]', '--m');
35 text([secInsertion+2], [0.024], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
36 text(0.35,1.2,
'column 1');
39 xlab = xlabel(
'time [s]');
40 leg = legend(
'$\dot{q}_1$',
'$\dot{q}_2$',
'$\dot{q}_3$',
'$\dot{q}_4$');
41 ylab = ylabel(
'Joint velocities [rad/s]');
42 if strcmp(robotName,
'g500_A')
43 tq = title('Joint command for Robot A');
44 text(0.35,1.2,'column 1');
46 tq = title('Joint command for Robot B');
50 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
51 set (ylab, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
52 set (xlab, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
53 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
62 plot([secInsertion; secInsertion], [-0.06,0.03]', '--m');
63 text([secInsertion+2], [0.024], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
65 xlab = xlabel(
'time [s]');
66 leg = legend(
'$\dot{q}_1$',
'$\dot{q}_2$',
'$\dot{q}_3$',
'$\dot{q}_4$');
71 set(leg,
'Interpreter',
'latex',
'FontSize' , legFontSize);
72 set (ylab,
'Interpreter',
'latex',
'FontSize', ylabFontSize);
73 set (xlab,
'Interpreter',
'latex',
'FontSize', xlabFontSize);
75 %% plot vehicle command divided lin
83 plot([secInsertion; secInsertion], [-0.02, 0.12]
', '--m');
84 text([secInsertion+2], [0.11], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
86 xlab1 = xlabel(
'time [s]');
87 ylab1 = ylabel(
'Linear velocity [m/s]');
89 if strcmp(robotName,
'g500_A')
90 tq1 = title('Joint command for Robot A');
92 tq1 = title('Joint command for Robot B');
94 leg1 = legend('$\dot{x}$
','$\dot{y}$
', '$\dot{z}$
'); 95 set(leg1, 'Interpreter
', 'latex
', 'FontSize
' , legFontSize); 96 set (ylab1, 'Interpreter
', 'latex
', 'FontSize
', ylabFontSize); 97 set (xlab1, 'Interpreter
', 'latex
', 'FontSize
', xlabFontSize); 98 set (tq1, 'Interpreter
', 'latex
', 'FontSize
' , titleFontSize); 110 plot([secInsertion; secInsertion], [-0.02, 0.12]',
'--m');
111 text([secInsertion+2], [0.11], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
113 xlab1 = xlabel(
'time [s]');
118 leg1 = legend(
'$\dot{x}$',
'$\dot{y}$',
'$\dot{z}$');
119 set(leg1,
'Interpreter',
'latex',
'FontSize' , legFontSize);
120 set (ylab1,
'Interpreter',
'latex',
'FontSize', ylabFontSize);
121 set (xlab1,
'Interpreter',
'latex',
'FontSize', xlabFontSize);
124 %% plot vehicle command divided ang
132 plot([secInsertion; secInsertion], [-0.005, 0.045]
', '--m');
133 text([secInsertion+2], [0.041], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
135 xlab2 = xlabel(
'time [s]');
136 ylab2 = ylabel(
'Angular velocity [rad/s]');
137 ylim([-0.005, 0.045])
139 if strcmp(robotName, 'g500_A')
140 tq2 = title('Joint command for Robot A');
142 tq2 = title('Joint command for Robot B');
145 leg2 = legend('$w_x$', '$w_y$', '$w_z$');
146 set(leg2, 'Interpreter', 'latex', 'FontSize' , legFontSize);
147 set (ylab2, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
148 set (xlab2, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
149 set (tq2, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
157 plot([secInsertion; secInsertion], [-0.005, 0.045]', '--m');
158 text([secInsertion+2], [0.041], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
160 xlab2 = xlabel(
'time [s]');
161 ylim([-0.005, 0.045])
163 leg2 = legend('$w_x$', '$w_y$', '$w_z$');
164 set(leg2, 'Interpreter', 'latex', 'FontSize' , legFontSize);
165 set (ylab2, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
166 set (xlab2, 'Interpreter', 'latex', 'FontSize', xlabFontSize);