AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
task.h
1 #ifndef TASK_H
2 #define TASK_H
3 
4 #include <iostream>
5 #include <cmat/cmat.h>
6 #include <Eigen/Core>
7 #include "../../support/header/defines.h"
8 #include "../../helper/header/infos.h"
9 
10 
17 class Task
18 {
19 private:
20 
21 
22 protected:
23  int dimension; //dimension of the task (1 for scalar task); (rows)
24  int dof; //total dofs of the robot (columns)
25  std::string taskName;
26  std::string robotName;
27  CMAT::Matrix J; // the Jacobian
28  CMAT::Matrix A; //the Activation function
29  CMAT::Matrix reference;
30  CMAT::Matrix error; //that is the reference without gain and saturation, useful for plotting result
31 
32 
33  int flag_W;
34  double mu_W;
35  int flag_G;
36  double mu_G;
37 
38  int threshold;
39  int lambda;
40 
41  Task(int dimension, bool eqType,
42  std::string robotName, std::string taskName);
43 
44 public:
45 
46  bool updated; //to not call computeMatrices on task that were contained also in previous TPIKs list
47 
48 
49  virtual ~Task();
50 
51  virtual int updateMatrices(struct Infos* const robInfo) = 0;
52 
53  // int writeLogs();
54  std::string getName();
55  CMAT::Matrix getJacobian();
56  CMAT::Matrix getActivation();
57  CMAT::Matrix getReference();
58  CMAT::Matrix getError();
59 
60  //note why &:
61  // value passed to cmar regPseudoinv that must be lvalue because:
62  //Matrix& Matrix::RegPseudoInverse(double threshold, double lambda, double& mu, int& flag) const
63  // these gets are used only to pass values to that cmat function
64  int& getFlag_W();
65  double& getMu_W();
66  int& getFlag_G();
67  double& getMu_G();
68  void setFlag_W(int);
69  void setMu_W(double);
70  void setFlag_G(int);
71  void setMu_G(double);
72 
73 
74  int getThreshold();
75  int getLambda();
76  int getDof();
77  int getDimension();
78 
79  bool eqType;
80  double gain;
81 
82 };
83 
84 #endif // TASK_H
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
Definition: infos.h:117
ABSTRACT class task. Each task is a derived class of this class. It contains all the variable that th...
Definition: task.h:17