AUV-Coop-Assembly
Master Thesis for Robotics Engineering. Cooperative peg-in-hole assembly with two underwater vehicles guided by vision
vehicleConstrainVelTask.cpp
1 #include "header/vehicleConstrainVelTask.h"
2 
3 VehicleConstrainVelTask::VehicleConstrainVelTask(int dim, bool eqType, std::string robotName)
4  : Task(dim, eqType, robotName, "VEHICLE_CONSTRAIN_VEL") {
5  //no gain: non reactive task
6 
7 }
8 
9 
16 
17  setActivation();
18  setJacobian();
19  setReference(robInfo->robotState.vehicleVel);
20  return 0;
21 }
22 
27 void VehicleConstrainVelTask::setJacobian(){
28 
29  Eigen::Matrix<double, 6, TOT_DOF> J_eigen = Eigen::Matrix<double, 6, TOT_DOF>::Zero();
30  J_eigen.rightCols(dimension) = Eigen::Matrix<double, 6, 6>::Identity();
31 
32  J = CONV::matrix_eigen2cmat(J_eigen);
33 
34 
35 }
36 
37 void VehicleConstrainVelTask::setActivation(){
38 
39  double vectDiag[dimension];
40  std::fill_n(vectDiag, dimension, 1);
41  this->A.SetDiag(vectDiag);
42 }
50 void VehicleConstrainVelTask::setReference(std::vector<double> actualVel){
51 
52  for (int i=1; i<=dimension; ++i){
53  this->reference(i) = actualVel[i-1];
54  }
55 }
56 
std::vector< double > vehicleVel
vehicle and joint
Definition: infos.h:45
int updateMatrices(struct Infos *const robInfo)
VehicleConstrainVelTask::updateMatrices overriden of the pure virtual method of Task parent class...
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