AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
main.m
1 clearvars;
2 
3 rootPath = '~/logPegBella/all/';
4 robotNameA = 'g500_A';
5 robotNameB = 'g500_B';
6 coordName = 'Coordinator/';
7 
8 %millisecond indicated in missionManager
9 global sControlLoop
10 sControlLoop = 0.1;
11 %sControlLoop = 0.05; %original 0.1 = 100 ms
12 
13 %% plot Task things
14 
15 % taskName = 'FORCE_INSERTION';
16 %taskName = 'JOINT_LIMIT';
17 %
18 %plotTask(rootPath, robotNameA, taskName);
19 %plotTask(rootPath, robotNameB, taskName);
20 
21 
22 %% plot yDots (command sent to robot)
23 %plotYDot(rootPath, robotNameA, 'yDotTPIK1');
24 %plotYDot(rootPath, robotNameA, 'yDotFinal');
25 %plotYDotDivided(rootPath, robotNameA, 'yDotTPIK1'); %ang e lin vel of vehicle divided
26 % plotYDotDivided(rootPath, robotNameA, 'yDotFinal');
27 % plotYDotDivided(rootPath, robotNameA, 'yDotFinalWithCollision');
28 plotForcesWorld(rootPath, robotNameA);
29 plotTorquesWorld(rootPath, robotNameA);
30 %plot6DVectorDivided(rootPath, robotNameA, 'toolVel4Collision');
31 %plotVector(rootPath, robotNameA, 'forces');
32 %plotVector(rootPath, robotNameA, 'torques');
33 
34 
35 % plotYDot(rootPath, robotNameB, 'yDotTPIK1');
36 % plotYDot(rootPath, robotNameB, 'yDotFinal');
37 
38 %% plot coord things
39 % plotNonCoopVel(rootPath, coordName, robotNameA);
40 % plotNonCoopVel(rootPath, coordName, robotNameB);
41 % plotCoopVel(rootPath, coordName);
42 % plotCoopGeneric(rootPath, coordName, 'weightA');
43 % plotCoopGeneric(rootPath, coordName, 'weightB');
44 % plotCoopGeneric(rootPath, coordName, 'notFeasibleCoopVel');
45 % plotCoopGeneric(rootPath, coordName, 'idealTool');
46 %plotDifferenceCoopVel(rootPath, robotNameA, robotNameB)
47 %plotStressTool(rootPath, coordName);
48 
49 
50 %% diff tra feasabile e non coop velocities
51 % legFontSize = 13;
52 % titleFontSize = 16;
53 % ylabFontSize = 15;
54 %
55 % fileName = strcat('nonCoopVel', robotNameB, '.txt');
56 % xDot1 = importMatrices(strcat(rootPath, coordName, fileName));
57 % nRow = size(xDot1, 1);
58 % nStep = size(xDot1, 3);
59 %
60 % %millisecond indicated in missionManager
61 % totSecondPassed = sControlLoop*(nStep-1);
62 % seconds = 0:sControlLoop:totSecondPassed;
63 %
64 % fileName = strcat('idealTool', '.txt');
65 % xDot2 = importMatrices(strcat(rootPath, coordName, fileName));
66 %
67 % diff = xDot2 - xDot1;
68 % figure
69 % hold on;
70 % for i = 1:nRow
71 % a(:) = diff(i,1,:);
72 % plot(seconds, a);
73 % end
74 % xlabel('time [s]');
75 
76 %% Plot goal moving for change_goal and pose tool
77 plotTransformMatrices(rootPath, coordName);
78 plotGenericErrorDivided(strcat(rootPath, coordName, "realgoal_Tool_error.txt"));
79 
80 
81 %% Vision
82 %pathName ="logVisionGood/templ/mono/g500_C/errorMonoL.txt";
83 %plotGenericErrorDividedNorm(pathName)
84 %pathName ="logVisionGood/templ/mono/g500_C/errorMonoR.txt";
85 %plotGenericErrorDividedNorm(pathName)
86 
87 pathName ="logVisionGood/square/mono/g500_C/errorMonoL.txt";
88 plotGenericErrorDivided(pathName, 'Tracking_error', 'yes');
89 %pathName ="logVisionGood/templ/depth/g500_C/errorStereoL.txt";
90 %plotGenericErrorDividedNorm(pathName)
ABSTRACT class task. Each task is a derived class of this class. It contains all the variable that th...
Definition: task.h:17