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