AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
plotGenericError.m
1 function plotGenericError(pathName)
2 
3 legFontSize = 13;
4 titleFontSize = 16;
5 ylabFontSize = 15;
6 
7 errors = importMatrices(pathName);
8 nRow = size(errors, 1);
9 nStep = size(errors, 3);
10 
11 global sControlLoop
12 totSecondPassed = sControlLoop*(nStep-1);
13 seconds = 0:sControlLoop:totSecondPassed;
14 
15 figure
16 hold on;
17 for i = 1:nRow
18  a(:) = errors(i,1,:);
19  plot(seconds, a);
20 end
21 xlabel('time [s]');
22 ylab = ylabel('errors [m, rad]');
23 
24 tq = title("Cartesian Error");
25 
26 leg = legend('$x$','$y$', '$z$', '$roll$', '$pitch$', '$yaw$');
27 set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
28 set(ylab, 'Interpreter', 'latex', 'FontSize' , ylabFontSize);
29 
30 set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
31 hold off
32 
33 
34 
35 
36 
37 
38 %% plot vel norm
39 % figure
40 % hold on;
41 % for i = 1:nRow
42 % a(:) = norms(i,1,:);
43 % plot(seconds, a);
44 % end
45 % xlabel('time [s]');
46 % ylab = ylabel('norms');
47 %
48 % tq = title("Norms (lin, ang) of Cartesian Error between the two coincident pipes");
49 %
50 % leg = legend('Linear', 'Angular');
51 % set(leg, 'Interpreter', 'latex', 'FontSize' , legFontSize);
52 % set(ylab, 'Interpreter', 'none', 'FontSize' , ylabFontSize);
53 %
54 % set (tq, 'Interpreter', 'latex', 'FontSize' , titleFontSize);
55 % hold off