AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
plotDifferenceCoopVel.m
1 function plotDifferenceCoopVel(rootPath, robotNameA, robotNameB)
2 
3 legFontSize = 13;
4 titleFontSize = 16;
5 ylabFontSize = 15;
6 
7 xDotstr = '/toolCartVelCoop.txt';
8 xDotA = importMatrices(strcat(rootPath, robotNameA, xDotstr));
9 xDotB = importMatrices(strcat(rootPath, robotNameB, xDotstr));
10 nRow = min(size(xDotA, 1), size(xDotB, 1));
11 nStep = min(size(xDotA, 3), size(xDotB, 3));
12 
13 %millisecond indicated in missionManager
14 global sControlLoop
15 totSecondPassed = sControlLoop*(nStep-1);
16 seconds = 0:sControlLoop:totSecondPassed;
17 
18 diff = xDotA - xDotB;
19 
20 % plot joint commands
21 figure
22 hold on;
23 for i = 1:nRow
24  a(:) = diff(i,1,:);
25  plot(seconds, a);
26 end
27 xlabel('time [s]');
28 ylab = ylabel('differences');
29 leg = legend('$\dot{x}$','$\dot{y}$', '$\dot{z}$', '$w_x$', '$w_y$', '$w_z$');
30 tq = title("Difference of cartesian velocity applied to tool");
31 
32 set(ylab, 'Interpreter', 'latex', 'FontSize' , ylabFontSize);
33 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
34 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
35 
36 
37 hold off