AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
plotVector.m
1 function plotVector(rootPath, robotName, vecName)
2 
3 legFontSize = 13;
4 titleFontSize = 16;
5 ylabFontSize = 15;
6 
7 vecNamestr = strcat( '/', vecName, '.txt');
8 vec = importMatrices(strcat(rootPath, robotName, vecNamestr));
9 nRow = size(vec, 1);
10 nStep = size(vec, 3);
11 
12 %millisecond indicated in missionManager
13 global sControlLoop
14 totSecondPassed = sControlLoop*(nStep-1);
15 seconds = 0:sControlLoop:totSecondPassed;
16 
17 % plot joint commands
18 figure
19 hold on;
20 for i = 1:nRow
21  a(:) = vec(i,1,:);
22  plot(seconds, a);
23 end
24 xlabel('time [s]');
25 leg = legend('x','y', 'z');
26 ylab = ylabel(' vector [?]');
27 tq = title(strcat(robotName, " " ,vecName));
28 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
29 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
30 set (ylab, 'Interpreter', 'latex', 'FontSize', ylabFontSize);
31 hold off