AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
task.cpp
1 #include "header/task.h"
2 
12 Task::Task(int dimension, bool eqType,
13  std::string robotName, std::string taskName)
14 {
15 
16  this->dimension = dimension;
17  this->dof = TOT_DOF;
18  this->eqType = eqType;
19  this->robotName = robotName;
20  this->taskName = taskName;
21 
22  updated = false;
23 
24  J = CMAT::Matrix::Zeros(dimension, dof);
25  A = CMAT::Matrix::Zeros(dimension, dimension);
26  reference = CMAT::Matrix::Zeros(dimension,1);
27  error = CMAT::Matrix::Zeros(dimension,1);
28 
29  threshold = THRESHOLD_DEFAULT;
30  lambda = LAMBDA_DEFAULT;
31 
32  //for reg pseudoinverse of cmat
33  flag_W = 0;
34  mu_W = 0.0;
35  flag_G = 0;
36  mu_G = 0.0;
37 
38  std::cout << "[" << robotName <<"]["<< taskName << "]" << " Created" << std::endl;
39 }
40 
41 Task::~Task(){}
42 
43 std::string Task::getName(){return this->taskName;}
44 CMAT::Matrix Task::getJacobian(){ return this->J;}
45 CMAT::Matrix Task::getActivation(){return this->A;}
46 CMAT::Matrix Task::getReference(){return this->reference;}
47 CMAT::Matrix Task::getError(){return this->error;}
48 
49 
57 int& Task::getFlag_W(){return this->flag_W;}
65 double& Task::getMu_W(){return this->mu_W;}
73 int& Task::getFlag_G(){return this->flag_G;}
81 double& Task::getMu_G(){return this->mu_G;}
82 
83 void Task::setFlag_G(int v){this->flag_G = v;}
84 void Task::setFlag_W(int v){this->flag_W = v;}
85 void Task::setMu_G(double v){this->mu_G = v;}
86 void Task::setMu_W(double v){this->mu_W = v;}
87 
88 
89 int Task::getThreshold(){return this->threshold;}
90 int Task::getLambda(){return this->lambda;}
91 int Task::getDof(){return this->dof;}
92 int Task::getDimension(){return this->dimension;}
93 
94 
96 //int Task::writeLogs(){
97 // if (logger == NULL){
98 // return -1;
99 // }
100 
101 // logger->writeActivation(A);
102 // logger->writeReference(reference);
103 // return 0;
104 //}
105 
106 
int & getFlag_G()
Task::getFlag_G Various getter methods.
Definition: task.cpp:73
int & getFlag_W()
Task::getFlag_W Various getter methods.
Definition: task.cpp:57
Task(int dimension, bool eqType, std::string robotName, std::string taskName)
Task::Task Constructor called by sons Constructor. without argument dof, default dof from define...
Definition: task.cpp:12
double & getMu_G()
Task::getMu_G Various getter methods.
Definition: task.cpp:81
double & getMu_W()
Task::getMu_W Various getter methods.
Definition: task.cpp:65