1 #include "header/horizontalAttitudeTask.h" 3 HorizontalAttitudeTask::HorizontalAttitudeTask(
int dim,
bool eqType, std::string robotName)
4 :
Task(dim, eqType, robotName,
"HORIZONTAL_ATTITUDE"){
7 std::cerr <<
"[" << robotName <<
"][" << taskName <<
"] ERROR, this task is intended to be a scalar one, "<<
8 "you setted "<< dimension <<
" as dimension\n";
16 int HorizontalAttitudeTask::updateMatrices(
Infos*
const robInfo){
32 void HorizontalAttitudeTask::setPhi(Eigen::Matrix4d wTv_eigen){
38 Eigen::Matrix3d wRv_eigen = wTv_eigen.topLeftCorner(3,3);
39 Eigen::Vector3d v_kHat_w = wRv_eigen.transpose() * kHat;
41 phi = FRM::reducedVersorLemma(v_kHat_w, kHat);
48 void HorizontalAttitudeTask::setActivation(){
51 A(1) = CMAT::IncreasingBellShapedFunction(0.025, 0.1, 0, 1, phi.norm());
54 void HorizontalAttitudeTask::setJacobian(){
56 Eigen::Vector3d normalPhi;
57 double normPhi = phi.norm();
59 normalPhi = phi/normPhi;
65 Eigen::MatrixXd J_eigen(dimension, dof);
66 Eigen::Matrix<double, 3, VEHICLE_DOF> temp;
67 temp.topLeftCorner(3,3) = Eigen::Matrix3d::Zero();
68 temp.topRightCorner(3,3) = Eigen::Matrix3d::Identity();
71 J_eigen.topLeftCorner(dimension, ARM_DOF) = Eigen::RowVectorXd::Zero(ARM_DOF);
72 J_eigen.topRightCorner(dimension, VEHICLE_DOF) = normalPhi.transpose() * temp;
74 J = CONV::matrix_eigen2cmat(J_eigen);
77 void HorizontalAttitudeTask::setReference(){
79 reference(1) = -gain * phi.norm();
Eigen::Matrix4d wTv_eigen
Transforms.
ABSTRACT class task. Each task is a derived class of this class. It contains all the variable that th...