1 function plotYDotDivided3(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 %% plot joint commands
26 figure('Renderer', 'painters', 'Position', [0 0 750 990])
35 plot([secInsertion; secInsertion], [-0.06,0.03]', '--m');
36 text([secInsertion+2], [0.024], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
38 xlab = xlabel(
'time [s]');
39 leg = legend(
'$\dot{q}_1$',
'$\dot{q}_2$',
'$\dot{q}_3$',
'$\dot{q}_4$');
40 ylab = ylabel(
'Joint velocities [rad/s]');
41 if strcmp(robotName,
'g500_A')
42 tq = title('Joint command for Robot A');
44 tq = title('Joint command for Robot B');
47 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
48 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
49 set (ylab, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
50 set (xlab, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
58 plot([secInsertion; secInsertion], [-0.06,0.03]', '--m');
59 text([secInsertion+2], [0.024], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
61 xlab = xlabel(
'time [s]');
62 leg = legend(
'$\dot{q}_1$',
'$\dot{q}_2$',
'$\dot{q}_3$',
'$\dot{q}_4$');
63 ylab = ylabel(
'Joint velocities [rad/s]');
64 if strcmp(robotName,
'g500_A')
65 tq = title('Joint command for Robot A');
67 tq = title('Joint command for Robot B');
70 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
71 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
72 set (ylab, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
73 set (xlab, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
76 %% plot vehicle command divided in angle e lin
84 plot([secInsertion; secInsertion], [-0.02, 0.12]', '--m');
85 text([secInsertion+2], [0.11], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
87 xlab1 = xlabel(
'time [s]');
88 ylab1 = ylabel(
'Linear velocity [m/s]');
89 if strcmp(robotName,
'g500_A')
90 tq1 = title('Vehicle linear velocity command for Robot A');
92 tq1 = title('Vehicle linear velocity command for Robot B');
94 leg1 = legend('$\dot{x}$
','$\dot{y}$
', '$\dot{z}$
'); 95 set(leg1, 'Interpreter
', 'latex
', 'FontSize
' , legFontSize); 96 set (tq1, 'Interpreter
', 'latex
', 'FontSize
' , titleFontSize); 97 set (ylab1, 'Interpreter
', 'latex
', 'FontSize
', ylabFontSize); 98 set (xlab1, 'Interpreter
', 'latex
', 'FontSize
', xlabFontSize); 109 plot([secInsertion; secInsertion], [-0.005, 0.045]',
'--m');
110 text([secInsertion+2], [0.041], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
112 xlab2 = xlabel(
'time [s]');
113 ylab2 = ylabel(
'Angular velocity [rad/s]');
114 if strcmp(robotName,
'g500_A')
115 tq2 = title('Vehicle angular velocity command for Robot A');
117 tq2 = title('Vehicle angular velocity command for Robot B');
119 leg2 = legend('$w_x$', '$w_y$', '$w_z$');
120 set(leg2, 'Interpreter', 'latex', 'FontSize' , legFontSize);
121 set (tq2, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
122 set (ylab2, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
123 set (xlab2, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
124 ylim([-0.005, 0.045])