AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
controller.h
1 #ifndef CONTROLLER_H
2 #define CONTROLLER_H
3 
4 #include <cmat/cmat.h>
5 
6 #include "../../support/header/defines.h"
7 #include "../../support/header/prints.h"
8 #include "../../support/header/conversions.h"
9 #include "../../helper/header/infos.h"
10 
11 #include "../../tasks/header/task.h"
12 
13 
20 class Controller {
21 
22 public:
23 
24  Controller(std::string robotName);
25 
26  int updateMultipleTasksMatrices(std::vector<Task*> tasks, struct Infos* const robInfo);
27  int updateSingleTaskMatrices(Task* task, struct Infos* const robInfo);
28  std::vector<double> execAlgorithm(std::vector<Task*> tasks);
29 
30  int resetAllAlgosFlag(std::vector<Task*> tasks);
31  int resetAllUpdatedFlags(std::vector<Task*> tasks);
32 
33 private:
34  std::string robotName; //to differentiate robots in log folders and printsconsole
35  int equalityIcat(Task* task, CMAT::Matrix* rhop, CMAT::Matrix* Q);
36  int inequalityIcat(Task* task, CMAT::Matrix* rhop, CMAT::Matrix* Q) ;
37 };
38 
39 
40 #endif // CONTROLLER_H
The Controller class is responsabile of 1) taking matrices and giving them to Tasks classes...
Definition: controller.h:20
Controller(std::string robotName)
Controller::Controller constructor.
Definition: controller.cpp:7
int resetAllUpdatedFlags(std::vector< Task * > tasks)
Controller::resetAllUpdatedFlags to be called at the end of the control loop, so next loop all matric...
Definition: controller.cpp:63
std::vector< double > execAlgorithm(std::vector< Task * > tasks)
Controller::execAlgorithm this function calls the step of the algorithm modifying (in the for) each t...
Definition: controller.cpp:101
Definition: infos.h:117
int updateSingleTaskMatrices(Task *task, struct Infos *const robInfo)
Controller::updateSingleTaskMatrices This function calls the updateMatrices for a single task...
Definition: controller.cpp:43
ABSTRACT class task. Each task is a derived class of this class. It contains all the variable that th...
Definition: task.h:17
int updateMultipleTasksMatrices(std::vector< Task * > tasks, struct Infos *const robInfo)
Controller::updateAllTaskMatrices This function calls all the updateMatrices of each task...
Definition: controller.cpp:20
int resetAllAlgosFlag(std::vector< Task * > tasks)
Controller::resetAllAlgosFlag Flag_W Mu_W Flag_G Mu_G must be resetted before each TPIK...
Definition: controller.cpp:79