1 function plotYDotDivided(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])
34 plot([secInsertion; secInsertion], [-0.06,0.03]', '--m');
35 text([secInsertion+2], [0.024], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
37 xlab = xlabel(
'time [s]');
38 leg = legend(
'$\dot{q}_1$',
'$\dot{q}_2$',
'$\dot{q}_3$',
'$\dot{q}_4$');
39 ylab = ylabel(
'Joint velocities [rad/s]');
40 if strcmp(robotName,
'g500_A')
41 tq = title('Joint command for Robot A');
43 tq = title('Joint command for Robot B');
46 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
47 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
48 set (ylab, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
49 set (xlab, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
52 %% plot vehicle command divided in angle e lin
60 plot([secInsertion; secInsertion], [-0.02, 0.12]', '--m');
61 text([secInsertion+2], [0.11], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
63 xlab1 = xlabel(
'time [s]');
64 ylab1 = ylabel(
'Linear velocity [m/s]');
65 if strcmp(robotName,
'g500_A')
66 tq1 = title('Vehicle linear velocity command for Robot A');
68 tq1 = title('Vehicle linear velocity command for Robot B');
70 leg1 = legend('$\dot{x}$
','$\dot{y}$
', '$\dot{z}$
'); 71 set(leg1, 'Interpreter
', 'latex
', 'FontSize
' , legFontSize); 72 set (tq1, 'Interpreter
', 'latex
', 'FontSize
' , titleFontSize); 73 set (ylab1, 'Interpreter
', 'latex
', 'FontSize
', ylabFontSize); 74 set (xlab1, 'Interpreter
', 'latex
', 'FontSize
', xlabFontSize); 85 plot([secInsertion; secInsertion], [-0.005, 0.045]',
'--m');
86 text([secInsertion+2], [0.041], {
'\rightarrow Inside the hole'},
'Color',
'magenta',
'FontSize',14);
88 xlab2 = xlabel(
'time [s]');
89 ylab2 = ylabel(
'Angular velocity [rad/s]');
90 if strcmp(robotName,
'g500_A')
91 tq2 = title('Vehicle angular velocity command for Robot A');
93 tq2 = title('Vehicle angular velocity command for Robot B');
95 leg2 = legend('$w_x$', '$w_y$', '$w_z$');
96 set(leg2, 'Interpreter', 'latex', 'FontSize' , legFontSize);
97 set (tq2, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
98 set (ylab2, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
99 set (xlab2, 'Interpreter', 'latex', 'FontSize', xlabFontSize);
100 ylim([-0.005, 0.045])