97 this->
I3 =
GetInertiaMatrix(0.00006651, 0.00317406, 0.00318967, 0.00004913, 0.00000614, 0.0);
118 kindr::RotationMatrixD transformationBToW(kindr::EulerAnglesZyxD(baseOrientation(2),
124 kindr::RotationMatrixD transformationWToB(transformationBToW.transpose());
127 Vector3d positionFrontLeftFootInB(transformationWToB.matrix()*(positionFrontLeftFootInW - basePositionInW));
128 Vector3d positionFrontRightFootInB(transformationWToB.matrix()*(positionFrontRightFootInW - basePositionInW));
129 Vector3d positionRearLeftFootInB(transformationWToB.matrix()*(positionRearLeftFootInW - basePositionInW));
130 Vector3d positionRearRightFootInB(transformationWToB.matrix()*(positionRearRightFootInW - basePositionInW));
133 Eigen::Matrix<Eigen::Vector3d, 4, 1> positionHipsInB;
156 _q_r.block<3, 1>(0, 0) = q_r_fl;
157 _q_r.block<3, 1>(3, 0) = q_r_fr;
158 _q_r.block<3, 1>(6, 0) = q_r_rl;
159 _q_r.block<3, 1>(9, 0) = q_r_rr;
170 kindr::Position3D base_position(_q.block(0,0,2,0));
171 kindr::Position3D base_orientation(_q.block(3,0,5,0));
174 kindr::RotationMatrixD rotationWToB(kindr::EulerAnglesZyxD(base_orientation(2),
186 kindr::HomTransformMatrixD transformBaseToFrontLeftHip(positionBaseToFrontLeftInW, rotationWToB);
187 kindr::HomTransformMatrixD transformBaseToFrontRightHip(positionBaseToFrontRightInW, rotationWToB);
188 kindr::HomTransformMatrixD transformBaseToRearLeftHip(positionBaseToRearLeftInW, rotationWToB);
189 kindr::HomTransformMatrixD transformBaseToRearRightHip(positionBaseToRearRightInW, rotationWToB);
192 kindr::HomTransformMatrixD transformFrontLeftHipToFoot = this->
GetHipToBodyTransform(LegType::frontLeft,
197 kindr::HomTransformMatrixD transformFrontRightHipToFoot = this->
GetHipToBodyTransform(LegType::frontRight,
202 kindr::HomTransformMatrixD transformRearLeftHipToFoot = this->
GetHipToBodyTransform(LegType::rearLeft,
207 kindr::HomTransformMatrixD transformRearRightHipToFoot = this->
GetHipToBodyTransform(LegType::rearRight,
214 kindr::HomTransformMatrixD transformBaseToFrontLeftFoot = transformBaseToFrontLeftHip*transformFrontLeftHipToFoot;
215 kindr::HomTransformMatrixD transformBaseToFrontRightFoot = transformBaseToFrontRightHip*transformFrontRightHipToFoot;
216 kindr::HomTransformMatrixD transformBaseToRearLeftFoot = transformBaseToRearLeftHip*transformRearLeftHipToFoot;
217 kindr::HomTransformMatrixD transformBaseToRearRightFoot = transformBaseToRearRightHip*transformRearRightHipToFoot;
220 _f_pos(0) = base_position.vector() + transformBaseToFrontLeftFoot.transform(kindr::Position3D(0,0,0)).vector();
221 _f_pos(1) = base_position.vector() + transformBaseToFrontRightFoot.transform(kindr::Position3D(0,0,0)).vector();
222 _f_pos(2) = base_position.vector() + transformBaseToRearLeftFoot.transform(kindr::Position3D(0,0,0)).vector();
223 _f_pos(3) = base_position.vector() + transformBaseToRearRightFoot.transform(kindr::Position3D(0,0,0)).vector();
230 const double &_theta_hy,
231 const double &_theta_hp,
232 const double &_theta_kp)
242 Eigen::Vector3d pos = _h_pos + transformation.transform(kindr::Position3D(0,0,0)).vector();
257 Eigen::Vector3d pos = transformation.transform(kindr::Position3D(0, 0, 0)).vector();
264 Eigen::Matrix<double, 3, 1> pos;
266 double hy = _joint_angles(0);
267 double hp = _joint_angles(1);
268 double kp = _joint_angles(2);
270 pos(0) = std::cos(hy) * (this->
L1 + this->
L2 * std::cos(hp) + this->
L3 * std::cos(hp + kp));
271 pos(1) = std::sin(hy) * (this->
L1 + this->
L2 * std::cos(hp) + this->
L3 * std::cos(hp + kp));
272 pos(2) = - this->
L2 * std::sin(hp) - this->
L3 * sin(hp + kp);
274 if((_leg_type == LegType::frontRight) || (_leg_type == LegType::rearLeft))
291 Eigen::Matrix<double, 3, 1> zero = Eigen::Matrix<double, 3, 1>::Zero();
299 double x_e = _f_pos(0) - _h_pos(0);
300 double y_e = _f_pos(1) - _h_pos(1);
301 double z_e = _f_pos(2) - _h_pos(2);
304 double normHipToFootInXY = std::sqrt( std::pow(x_e, 2) + std::pow(y_e, 2) );
307 double normHipPitchToFoot = std::sqrt( std::pow(normHipToFootInXY - this->
L1, 2) + std::pow(z_e, 2) );
311 double zeta = std::atan2(-z_e, normHipToFootInXY - this->
L1);
314 double alpha = std::acos( ( std::pow(this->
L2, 2) + std::pow(this->
L3, 2) - std::pow(normHipPitchToFoot, 2) ) / ( 2 * this->
L2 * this->
L3 ) );
316 if (std::isnan(alpha))
318 ROS_INFO_STREAM(
"IK alpha returned nan, nominator was: " << ( std::pow(this->
L2, 2) + std::pow(this->L3, 2) - std::pow(normHipPitchToFoot, 2) ) / ( 2 * this->
L2 * this->L3 )
319 <<
" and normHipPitchToFoot was: " << normHipPitchToFoot );
325 double beta = std::acos( ( std::pow(normHipPitchToFoot, 2) + std::pow(this->
L2, 2) - std::pow(this->L3, 2) ) / ( 2 * normHipPitchToFoot * this->
L2 ) );
327 if (std::isnan(beta))
329 ROS_INFO_STREAM(
"IK beta returned nan, nominator was: " << ( std::pow(normHipPitchToFoot, 2) + std::pow(this->L2, 2) - std::pow(this->L3, 2) ) / ( 2 * normHipPitchToFoot * this->L2 )
330 <<
" and normHipPitchToFoot was: " << normHipPitchToFoot );
339 _joint_angles(0) = std::atan2(y_e, x_e);
342 _joint_angles(1) = beta - zeta;
350 _joint_angles(0) = std::atan2(y_e, x_e);
353 _joint_angles(1) = - beta + zeta;
364 Eigen::Matrix<double, 3, 1> zero = Eigen::Matrix<double, 3, 1>::Zero();
370 const double &_alpha,
372 const double &_theta)
377 kindr::RotationMatrixD R_z(kindr::AngleAxisD(_theta, unit_z));
378 kindr::RotationMatrixD R_x(kindr::AngleAxisD(_alpha, unit_x));
380 kindr::Position3D
position(_a*R_z.matrix()*unit_x + _d*unit_z);
381 kindr::RotationMatrixD rotation = R_z*R_x;
383 kindr::HomTransformMatrixD transformationAToB(
position, rotation);
385 return transformationAToB;
391 const double &_theta_hy,
392 const double &_theta_hp,
393 const double &_theta_kp)
396 kindr::HomTransformMatrixD
t1;
397 kindr::HomTransformMatrixD
t2;
398 kindr::HomTransformMatrixD
t3;
401 double roll_offset = 0;
431 ROS_ERROR_STREAM(
"[Kinematics::GetHipToBodyTransform] Could not determine leg type!");
526 ROS_ERROR_STREAM(
"[Kinematics::GetHipToBodyTransform] Could not determine body type!");
533 kindr::HomTransformMatrixD transformation =
t1*
t2*
t3;
535 return transformation;
540 const double &_pitch,
543 kindr::RotationMatrixD rotationWToB(kindr::EulerAnglesZyxD(_yaw,
548 return rotationWToB.matrix();
553 const double &_pitch,
555 const double &_roll_rate,
556 const double &_pitch_rate,
557 const double &_yaw_rate)
559 kindr::RotationMatrixD rotationWToB(kindr::EulerAnglesZyxD(_yaw,
564 kindr::LocalAngularVelocityD angularVelInB(_roll_rate,
568 kindr::RotationMatrixDiffD rotationWToBDiff(rotationWToB, angularVelInB);
570 return rotationWToBDiff.matrix();
575 const double &_pitch,
578 kindr::RotationMatrixD rotationWToC(kindr::EulerAnglesZyxD(_yaw,
583 return rotationWToC.matrix();
588 const double &_pitch,
590 const double &_roll_rate,
591 const double &_pitch_rate,
592 const double &_yaw_rate)
594 kindr::RotationMatrixD rotationWToC(kindr::EulerAnglesZyxD(_yaw,
599 kindr::LocalAngularVelocityD angularVelInC(_roll_rate,
603 kindr::RotationMatrixDiffD rotationWToCDiff(rotationWToC, angularVelInC);
605 return rotationWToCDiff.matrix();
610 const double &_pitch,
613 kindr::RotationMatrixD rotationCToB(kindr::EulerAnglesZyxD(_yaw,
618 return rotationCToB.matrix();
623 const double &_pitch,
625 const double &_roll_rate,
626 const double &_pitch_rate,
627 const double &_yaw_rate)
629 kindr::RotationMatrixD rotationCToB(kindr::EulerAnglesZyxD(_yaw,
634 kindr::LocalAngularVelocityD angularVelInB(_roll_rate,
638 kindr::RotationMatrixDiffD rotationCToBDiff(rotationCToB, angularVelInB);
640 return rotationCToBDiff.matrix();
646 const Eigen::Matrix<double, 18, 1> &_q)
648 Eigen::Matrix<double, 3, 1> positionBaseToBodyInB;
650 Eigen::Matrix<double, 3, 1> positionBaseToHipInB;
656 kindr::HomTransformMatrixD transformHipToBody;
702 ROS_ERROR_STREAM(
"[Kinematics::GetPositionBaseToBodyInB] Could not determine leg type!");
716 positionBaseToBodyInB = positionBaseToHipInB + transformHipToBody.transform(kindr::Position3D(0,0,0)).vector();
719 return positionBaseToBodyInB;
725 const double &_theta_hy,
726 const double &_theta_hp,
727 const double &_theta_kp)
729 Eigen::Matrix<double, 3, 3> J;
735 double c1 = std::cos(_theta_hy);
736 double s1 = std::sin(_theta_hy);
738 double c2 = std::cos(_theta_hp);
739 double s2 = std::sin(_theta_hp);
741 double c23 = std::cos(_theta_hp + _theta_kp);
742 double s23 = std::sin(_theta_hp + _theta_kp);
780 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInB] Could not determine body type!");
794 J(0, 0) = (l1 + l2 * c2 + l3 * c23) * (-s1);
795 J(1, 0) = (l1 + l2 * c2 + l3 * c23) * ( c1);
798 J(0, 1) = (-l2 * s2 - l3 * s23) * c1;
799 J(1, 1) = (-l2 * s2 - l3 * s23) * s1;
800 J(2, 1) = -l2 * c2 - l3 * c23;
802 J(0, 2) = -l3 * s23 * c1;
803 J(1, 2) = -l3 * s23 * s1;
812 J(0, 0) = (l1 + l2 * c2 + l3 * c23) * (-s1);
813 J(1, 0) = (l1 + l2 * c2 + l3 * c23) * ( c1);
816 J(0, 1) = (-l2 * s2 - l3 * s23) * c1;
817 J(1, 1) = (-l2 * s2 - l3 * s23) * s1;
818 J(2, 1) = l2 * c2 + l3 * c23;
820 J(0, 2) = -l3 * s23 * c1;
821 J(1, 2) = -l3 * s23 * s1;
828 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInB] Could not determine leg type!");
842 const Eigen::Matrix<double, 12, 1> &_q_r)
844 Eigen::Matrix<double, 3, 12> J = Eigen::Matrix<double, 3, 12>::Constant(0);
891 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInB] Could not determine leg type!");
913 const Eigen::Matrix<double, 18, 1> &_q)
916 Eigen::Matrix<double, 3, 18> J;
917 Eigen::Matrix<double, 3, 12> translationJacobianInB;
918 Eigen::Matrix<double, 3, 1> positionBaseToBodyInB;
919 Eigen::Matrix<double, 3, 3> rotationWToB;
929 translationJacobianInB.setZero();
930 positionBaseToBodyInB.setZero();
952 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInW] Could not determine body type!");
961 J.block<3, 3>(0,0).setIdentity();
962 J.block<3, 3>(0,3) = - rotationWToB * kindr::getSkewMatrixFromVector(positionBaseToBodyInB);
963 J.block<3, 12>(0,6) = rotationWToB * translationJacobianInB;
971 const Eigen::Matrix<double, 18, 1> &_q)
974 Eigen::Matrix<double, 3, 18> J;
975 Eigen::Matrix<double, 3, 12> translationJacobianInB;
976 Eigen::Matrix<double, 3, 1> positionBaseToBodyInB;
977 Eigen::Matrix<double, 3, 3> rotationCToB;
987 translationJacobianInB.setZero();
988 positionBaseToBodyInB.setZero();
1010 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInW] Could not determine body type!");
1019 J.block<3, 3>(0,0).setIdentity();
1020 J.block<3, 3>(0,3) = - rotationCToB * kindr::getSkewMatrixFromVector(positionBaseToBodyInB);
1021 J.block<3, 12>(0,6) = rotationCToB * translationJacobianInB;
1029 const double &_theta_hy,
1030 const double &_theta_hp,
1031 const double &_theta_kp,
1032 const double &_dot_theta_hy,
1033 const double &_dot_theta_hp,
1034 const double &_dot_theta_kp)
1036 Eigen::Matrix<double, 3, 3> dot_J;
1042 double c1 = std::cos(_theta_hy);
1043 double s1 = std::sin(_theta_hy);
1045 double c2 = std::cos(_theta_hp);
1046 double s2 = std::sin(_theta_hp);
1048 double c23 = std::cos(_theta_hp + _theta_kp);
1049 double s23 = std::sin(_theta_hp + _theta_kp);
1087 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInBDiff] Could not determine body type!");
1101 dot_J(0, 0) = ( l2 * s2 * _dot_theta_hp + l3 * s23 * (_dot_theta_hp + _dot_theta_kp) ) * (-s1)
1102 + ( l1 + l2 * c2 + l3 * c23 ) * (-c1 * _dot_theta_hy);
1103 dot_J(1, 0) = ( l2 * s2 * _dot_theta_hp + l3 * s23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1104 + ( l1 + l2 * c2 + l3 * c23 ) * (-s1 * _dot_theta_hy);
1107 dot_J(0, 1) = ( -l2 * c2 * _dot_theta_hp - l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1108 + ( -l2 * s2 - l3 * s23 ) * (-s1 * _dot_theta_hy);
1109 dot_J(1, 1) = ( -l2 * c2 * _dot_theta_hp - l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (s1)
1110 + ( -l2 * s2 - l3 * s23 ) * (c1 * _dot_theta_hy);
1111 dot_J(2, 1) = l2 * s2 * _dot_theta_hp + l3 * s23 * (_dot_theta_hp + _dot_theta_kp);
1113 dot_J(0, 2) = ( -l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1114 + ( -l3 * s23 ) * (-s1 * _dot_theta_hy);
1115 dot_J(1, 2) = ( -l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (s1)
1116 + ( -l3 * s23 ) * (c1 * _dot_theta_hy);
1117 dot_J(2, 2) = l3 * s23 * (_dot_theta_hp + _dot_theta_kp);
1125 dot_J(0, 0) = ( l2 * s2 * _dot_theta_hp + l3 * s23 * (_dot_theta_hp + _dot_theta_kp) ) * (-s1)
1126 + ( l1 + l2 * c2 + l3 * c23 ) * (-c1 * _dot_theta_hy);
1127 dot_J(1, 0) = ( l2 * s2 * _dot_theta_hp + l3 * s23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1128 + ( l1 + l2 * c2 + l3 * c23 ) * (-s1 * _dot_theta_hy);
1131 dot_J(0, 1) = ( -l2 * c2 * _dot_theta_hp - l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1132 + ( -l2 * s2 - l3 * s23 ) * (-s1 * _dot_theta_hy);
1133 dot_J(1, 1) = ( -l2 * c2 * _dot_theta_hp - l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (s1)
1134 + ( -l2 * s2 - l3 * s23 ) * (c1 * _dot_theta_hy);
1135 dot_J(2, 1) = - l2 * s2 * _dot_theta_hp - l3 * s23 * (_dot_theta_hp + _dot_theta_kp);
1137 dot_J(0, 2) = ( -l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (c1)
1138 + ( -l3 * s23 ) * (-s1 * _dot_theta_hy);
1139 dot_J(1, 2) = ( -l3 * c23 * (_dot_theta_hp + _dot_theta_kp) ) * (s1)
1140 + ( -l3 * s23 ) * (c1 * _dot_theta_hy);
1141 dot_J(2, 2) = - l3 * s23 * (_dot_theta_hp + _dot_theta_kp);
1147 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInBDiff] Could not determine leg type!");
1161 const Eigen::Matrix<double, 12, 1> &_q_r,
1162 const Eigen::Matrix<double, 12, 1> &_dot_q_r)
1164 Eigen::Matrix<double, 3, 12> dot_J = Eigen::Matrix<double, 3, 12>::Constant(0);
1171 double dot_theta_hy;
1172 double dot_theta_hp;
1173 double dot_theta_kp;
1184 dot_theta_hy = _dot_q_r(0);
1185 dot_theta_hp = _dot_q_r(1);
1186 dot_theta_kp = _dot_q_r(2);
1197 dot_theta_hy = _dot_q_r(3);
1198 dot_theta_hp = _dot_q_r(4);
1199 dot_theta_kp = _dot_q_r(5);
1210 dot_theta_hy = _dot_q_r(6);
1211 dot_theta_hp = _dot_q_r(7);
1212 dot_theta_kp = _dot_q_r(8);
1220 theta_hp = _q_r(10);
1221 theta_kp = _q_r(11);
1223 dot_theta_hy = _dot_q_r(9);
1224 dot_theta_hp = _dot_q_r(10);
1225 dot_theta_kp = _dot_q_r(11);
1231 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInBDiff] Could not determine leg type!");
1256 const Eigen::Matrix<double, 18, 1> &_q,
1257 const Eigen::Matrix<double, 18, 1> &_u)
1260 Eigen::Matrix<double, 3, 18> dot_J;
1261 Eigen::Matrix<double, 3, 12> translationJacobianInB;
1262 Eigen::Matrix<double, 3, 12> translationJacobianInBDiff;
1263 Eigen::Matrix<double, 3, 1> positionBaseToBodyInB;
1264 Eigen::Matrix<double, 3, 1> positionBaseToBodyInBDiff;
1265 Eigen::Matrix<double, 3, 3> rotationWToB;
1266 Eigen::Matrix<double, 3, 3> rotationWToBDiff;
1273 translationJacobianInB.setZero();
1274 positionBaseToBodyInB.setZero();
1275 rotationWToB.setZero();
1276 rotationWToBDiff.setZero();
1299 positionBaseToBodyInBDiff = translationJacobianInB * _q.bottomRows(12);
1316 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInWDiff] Could not determine body type!");
1325 dot_J.block<3, 3>(0,0).setZero();
1327 dot_J.block<3, 3>(0,3) = - rotationWToBDiff * kindr::getSkewMatrixFromVector(positionBaseToBodyInB)
1328 - rotationWToB * kindr::getSkewMatrixFromVector(positionBaseToBodyInBDiff);
1330 dot_J.block<3, 12>(0,6) = rotationWToBDiff * translationJacobianInB
1331 + rotationWToB * translationJacobianInBDiff;
1339 const Eigen::Matrix<double, 18, 1> &_q,
1340 const Eigen::Matrix<double, 18, 1> &_u)
1343 Eigen::Matrix<double, 3, 18> dot_J;
1344 Eigen::Matrix<double, 3, 12> translationJacobianInB;
1345 Eigen::Matrix<double, 3, 12> translationJacobianInBDiff;
1346 Eigen::Matrix<double, 3, 1> positionBaseToBodyInB;
1347 Eigen::Matrix<double, 3, 1> positionBaseToBodyInBDiff;
1348 Eigen::Matrix<double, 3, 3> rotationCToB;
1349 Eigen::Matrix<double, 3, 3> rotationCToBDiff;
1356 translationJacobianInB.setZero();
1357 positionBaseToBodyInB.setZero();
1358 rotationCToB.setZero();
1359 rotationCToBDiff.setZero();
1382 positionBaseToBodyInBDiff = translationJacobianInB * _q.bottomRows(12);
1399 ROS_ERROR_STREAM(
"[Kinematics::GetTranslationJacobianInCDiff] Could not determine body type!");
1408 dot_J.block<3, 3>(0,0).setZero();
1410 dot_J.block<3, 3>(0,3) = - rotationCToBDiff * kindr::getSkewMatrixFromVector(positionBaseToBodyInB)
1411 - rotationCToB * kindr::getSkewMatrixFromVector(positionBaseToBodyInBDiff);
1413 dot_J.block<3, 12>(0,6) = rotationCToBDiff * translationJacobianInB
1414 + rotationCToB * translationJacobianInBDiff;
1422 const double &_theta_hy,
1423 const double &_theta_hp,
1424 const double &_theta_kp)
1426 Eigen::Matrix<double, 3, 3> J = Eigen::Matrix<double, 3, 3>::Constant(0);
1428 double c1 = std::cos(_theta_hy);
1429 double s1 = std::sin(_theta_hy);
1470 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInB] Could not determine body type!");
1517 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInB] Could not determine body type!");
1528 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInB] Could not determine leg type!");
1542 const Eigen::Matrix<double, 12, 1> &_q_r)
1544 Eigen::Matrix<double, 3, 12> J = Eigen::Matrix<double, 3, 12>::Constant(0);
1584 theta_hp = _q_r(10);
1585 theta_kp = _q_r(11);
1591 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInB] Could not determine leg type!");
1613 const Eigen::Matrix<double, 18, 1> &_q)
1615 Eigen::Matrix<double, 3, 18> J;
1616 Eigen::Matrix<double, 3, 12> rotationJacobianInB;
1617 Eigen::Matrix<double, 3, 3> rotationWToB;
1627 rotationJacobianInB.setZero();
1645 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInW] Could not determine body type!");
1653 J.block<3, 3>(0,0).setZero();
1654 J.block<3, 3>(0,3) = rotationWToB;
1655 J.block<3, 12>(0,6) = rotationWToB * rotationJacobianInB;
1663 const Eigen::Matrix<double, 18, 1> &_q)
1665 Eigen::Matrix<double, 3, 18> J;
1666 Eigen::Matrix<double, 3, 12> rotationJacobianInB;
1667 Eigen::Matrix<double, 3, 3> rotationCToB;
1677 rotationJacobianInB.setZero();
1695 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInW] Could not determine body type!");
1703 J.block<3, 3>(0,0).setZero();
1704 J.block<3, 3>(0,3) = rotationCToB;
1705 J.block<3, 12>(0,6) = rotationCToB * rotationJacobianInB;
1713 const double &_theta_hy,
1714 const double &_theta_hp,
1715 const double &_theta_kp,
1716 const double &_dot_theta_hy,
1717 const double &_dot_theta_hp,
1718 const double &_dot_theta_kp)
1720 Eigen::Matrix<double, 3, 3> dot_J = Eigen::Matrix<double, 3, 3>::Constant(0);
1722 double c1 = std::cos(_theta_hy);
1723 double s1 = std::sin(_theta_hy);
1739 dot_J(0,1) = - c1 * _dot_theta_hy;
1740 dot_J(1,1) = - s1 * _dot_theta_hy;
1748 dot_J(0,1) = - c1 * _dot_theta_hy;
1749 dot_J(1,1) = - s1 * _dot_theta_hy;
1751 dot_J(0,2) = - c1 * _dot_theta_hy;
1752 dot_J(1,2) = - s1 * _dot_theta_hy;
1758 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInBDiff] Could not determine body type!");
1780 dot_J(0,1) = c1 * _dot_theta_hy;
1781 dot_J(1,1) = s1 * _dot_theta_hy;
1789 dot_J(0,1) = c1 * _dot_theta_hy;
1790 dot_J(1,1) = s1 * _dot_theta_hy;
1792 dot_J(0,2) = c1 * _dot_theta_hy;
1793 dot_J(1,2) = s1 * _dot_theta_hy;
1799 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInBDiff] Could not determine body type!");
1810 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInBDiff] Could not determine leg type!");
1824 const Eigen::Matrix<double, 12, 1> &_q_r,
1825 const Eigen::Matrix<double, 12, 1> &_dot_q_r)
1827 Eigen::Matrix<double, 3, 12> dot_J = Eigen::Matrix<double, 3, 12>::Constant(0);
1834 double dot_theta_hy;
1835 double dot_theta_hp;
1836 double dot_theta_kp;
1847 dot_theta_hy = _dot_q_r(0);
1848 dot_theta_hp = _dot_q_r(1);
1849 dot_theta_kp = _dot_q_r(2);
1860 dot_theta_hy = _dot_q_r(3);
1861 dot_theta_hp = _dot_q_r(4);
1862 dot_theta_kp = _dot_q_r(5);
1873 dot_theta_hy = _dot_q_r(6);
1874 dot_theta_hp = _dot_q_r(7);
1875 dot_theta_kp = _dot_q_r(8);
1883 theta_hp = _q_r(10);
1884 theta_kp = _q_r(11);
1886 dot_theta_hy = _dot_q_r(9);
1887 dot_theta_hp = _dot_q_r(10);
1888 dot_theta_kp = _dot_q_r(11);
1894 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInBDiff] Could not determine leg type!");
1919 const Eigen::Matrix<double, 18, 1> &_q,
1920 const Eigen::Matrix<double, 18, 1> &_u)
1922 Eigen::Matrix<double, 3, 18> dot_J;
1923 Eigen::Matrix<double, 3, 12> rotationJacobianInB;
1924 Eigen::Matrix<double, 3, 12> rotationJacobianInBDiff;
1925 Eigen::Matrix<double, 3, 3> rotationWToB;
1926 Eigen::Matrix<double, 3, 3> rotationWToBDiff;
1932 rotationJacobianInB.setZero();
1933 rotationJacobianInBDiff.setZero();
1934 rotationWToB.setZero();
1953 _q.block<12, 1>(6,0));
1957 _q.block<12, 1>(6,0),
1958 _u.block<12, 1>(6,0));
1975 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInWDiff] Could not determine body type!");
1983 dot_J.block<3, 3>(0,0).setZero();
1984 dot_J.block<3, 3>(0,3) = rotationWToBDiff;
1985 dot_J.block<3, 12>(0,6) = rotationWToBDiff * rotationJacobianInB + rotationWToB * rotationJacobianInBDiff;
1993 const Eigen::Matrix<double, 18, 1> &_q,
1994 const Eigen::Matrix<double, 18, 1> &_u)
1996 Eigen::Matrix<double, 3, 18> dot_J;
1997 Eigen::Matrix<double, 3, 12> rotationJacobianInB;
1998 Eigen::Matrix<double, 3, 12> rotationJacobianInBDiff;
1999 Eigen::Matrix<double, 3, 3> rotationCToB;
2000 Eigen::Matrix<double, 3, 3> rotationCToBDiff;
2006 rotationJacobianInB.setZero();
2007 rotationJacobianInBDiff.setZero();
2008 rotationCToB.setZero();
2027 _q.block<12, 1>(6,0));
2031 _q.block<12, 1>(6,0),
2032 _u.block<12, 1>(6,0));
2049 ROS_ERROR_STREAM(
"[Kinematics::GetRotationJacobianInCDiff] Could not determine body type!");
2057 dot_J.block<3, 3>(0,0).setZero();
2058 dot_J.block<3, 3>(0,3) = rotationCToBDiff;
2059 dot_J.block<3, 12>(0,6) = rotationCToBDiff * rotationJacobianInB + rotationCToB * rotationJacobianInBDiff;
2067 const Eigen::Matrix<double, 18, 1> &_q)
2069 Eigen::Matrix<double, 6, 18> J;
2085 const Eigen::Matrix<double, 18, 1> &_q,
2086 const Eigen::Matrix<double, 18, 1> &_u)
2088 Eigen::Matrix<double, 6, 18> dot_J;
2105 const Eigen::Matrix<double, 18, 1> &_q)
2109 const unsigned int n_c = _legs.size();
2114 ROS_ERROR_STREAM(
"[Kinematics::GetContactJacobianInW] Zero contact points were given!");
2125 ROS_ERROR_STREAM(
"[Kinematics::GetContactJacobianInW] More than four contact points were given!");
2131 J.resize(3*n_c, 18);
2137 std::sort(_legs.begin(), _legs.end());
2157 const Eigen::Matrix<double, 18, 1> &_q,
2158 const Eigen::Matrix<double, 18, 1> &_u)
2160 Eigen::MatrixXd dot_J;
2162 const unsigned int n_c = _legs.size();
2167 ROS_ERROR_STREAM(
"[Kinematics::GetContactJacobianInWDiff] Zero contact points were given!");
2178 ROS_ERROR_STREAM(
"[Kinematics::GetContactJacobianInWDiff] More than four contact points were given!");
2184 dot_J.resize(3*n_c, 18);
2190 std::sort(_legs.begin(), _legs.end());
2211 const Eigen::Matrix<double, 18, 1> &_q)
2215 const unsigned int n_s = _legs.size();
2220 ROS_ERROR_STREAM(
"[Kinematics::GetSwingJacobianInW] Zero swing legs were given!");
2227 ROS_ERROR_STREAM(
"[Kinematics::GetSwingJacobianInW] More than four swing legs were given!");
2233 J.resize(3*n_s, 18);
2239 std::sort(_legs.begin(), _legs.end());
2260 const Eigen::Matrix<double, 18, 1> &_q,
2261 const Eigen::Matrix<double, 18, 1> &_u)
2263 Eigen::MatrixXd dot_J;
2265 const unsigned int n_s = _legs.size();
2270 ROS_ERROR_STREAM(
"[Kinematics::GetSwingJacobianInW] Zero swing legs were given!");
2277 ROS_ERROR_STREAM(
"[Kinematics::GetSwingJacobianInW] More than four swing legs were given!");
2283 dot_J.resize(3*n_s, 18);
2289 std::sort(_legs.begin(), _legs.end());
2311 const Eigen::Matrix<double, 18, 1> &_q)
2313 Eigen::Matrix<double, 3, 18> J_COM;
2314 Eigen::Matrix<double, 3, 18> J_R;
2316 Eigen::Matrix<double, 3, 3> I_COM;
2326 return m * J_COM.transpose() * J_COM + J_R.transpose() * I_COM * J_R;
2332 Eigen::Matrix<double, 18, 18> M = Eigen::Matrix<double, 18, 18>::Constant(0);
2335 static const std::vector<BodyType> bodies{ BodyType::base,
2340 static const std::vector<LegType> legs{ LegType::frontLeft,
2341 LegType::frontRight,
2343 LegType::rearRight };
2345 for (
const auto body : bodies)
2347 if (body == BodyType::base)
2353 for (
const auto leg : legs)
2365 Eigen::Matrix<double, 3, 3> M = Eigen::Matrix<double, 3, 3>::Zero();
2367 static const std::vector<BodyType> bodies{ BodyType::hip,
2371 Eigen::Matrix<double, 3, 3> J_s;
2373 Eigen::Matrix<double, 3, 3> J_r;
2375 for (
const auto body : bodies)
2388 const Eigen::Matrix<double, 18, 1> &_q,
2389 const Eigen::Matrix<double, 18, 1> &_u)
2391 Eigen::Matrix<double, 3, 18> J_COM;
2392 Eigen::Matrix<double, 3, 18> J_R;
2394 Eigen::Matrix<double, 3, 18> dot_J_COM;
2395 Eigen::Matrix<double, 3, 18> dot_J_R;
2397 Eigen::Matrix<double, 3, 1> Omega;
2399 Eigen::Matrix<double, 3, 3> I_COM;
2415 return m * J_COM.transpose() * dot_J_COM * _u + J_R.transpose() * ( I_COM * dot_J_R * _u + kindr::getSkewMatrixFromVector(Omega) * I_COM * Omega);
2420 const Eigen::Matrix<double, 18, 1> &_u)
2422 Eigen::Matrix<double, 18, 1>
b = Eigen::Matrix<double, 18, 1>::Constant(0);
2425 static const std::vector<BodyType> bodies{ BodyType::base,
2430 static const std::vector<LegType> legs{ LegType::frontLeft,
2431 LegType::frontRight,
2433 LegType::rearRight };
2435 for (
const auto body : bodies)
2437 if (body == BodyType::base)
2443 for (
const auto leg : legs)
2454 const Eigen::Matrix<double, 3, 1> &_u)
2456 Eigen::Matrix<double, 3, 1>
b = Eigen::Matrix<double, 3, 1>::Zero();
2458 static const std::vector<BodyType> bodies{ BodyType::hip,
2463 Eigen::Matrix<double, 3, 3> I;
2464 Eigen::Matrix<double, 3, 3> J_s;
2465 Eigen::Matrix<double, 3, 3> J_s_d;
2466 Eigen::Matrix<double, 3, 3> J_r;
2467 Eigen::Matrix<double, 3, 3> J_r_d;
2468 Eigen::Matrix<double, 3, 1> omega;
2472 for (
const auto body : bodies)
2481 b += J_s.transpose()*m*J_s_d*_u + J_r.transpose()*(I*J_r_d*_u + kindr::getSkewMatrixFromVector(omega)*I*omega);
2490 const Eigen::Matrix<double, 18, 1> &_q)
2492 Eigen::Matrix<double, 3, 18> J_COM;
2494 Eigen::Matrix<double, 3, 1> F_g;
2529 ROS_ERROR_STREAM(
"[Kinematics::GetSingleBodyGravitationalTerms] Could not determine body type!");
2537 F_g = m * g * Eigen::Matrix<double, 3, 1>(0,0,-1);
2539 return - J_COM.transpose() * F_g;
2545 Eigen::Matrix<double, 18, 1> g = Eigen::Matrix<double, 18, 1>::Constant(0);
2548 static const std::vector<BodyType> bodies{ BodyType::base,
2553 static const std::vector<LegType> legs{ LegType::frontLeft,
2554 LegType::frontRight,
2556 LegType::rearRight };
2558 for (
const auto body : bodies)
2560 if (body == BodyType::base)
2566 for (
const auto leg : legs)
2580 Eigen::Matrix<double, 3, 1> G = Eigen::Matrix<double, 3, 1>::Zero();
2584 static const std::vector<BodyType> bodies{ BodyType::hip,
2588 Eigen::Matrix<double, 3, 3> J_s;
2590 Eigen::Matrix<double, 3, 1> F;
2592 for (
const auto body : bodies)
2595 F =
GetBodyMass(body) * g * Eigen::Matrix<double, 3, 1>(0.0, 0.0, 1.0);
2596 G += J_s.transpose()*F;
2610 for (
size_t i = 0; i < _q_r.size(); i++)
2630 for (
size_t i = 0; i < 3; i++)
2643 const double &_I_YY,
2644 const double &_I_ZZ,
2645 const double &_I_XY,
2646 const double &_I_XZ,
2647 const double &_I_YZ)
2649 Eigen::Matrix<double, 3, 3> I;
2695 ROS_ERROR_STREAM(
"[Kinematics::GetBodyMass] Could not determine body type");
2707 Eigen::Matrix<double, 3, 3> I;
2737 ROS_ERROR_STREAM(
"[Kinematics::GetBodyInertia] Could not determine body type");
2749 if(_body == BodyType::hip)
2753 case LegType::frontLeft:
2754 case LegType::rearRight:
2757 case LegType::frontRight:
2758 case LegType::rearLeft:
2762 ROS_ERROR_STREAM(
"[Kinematics::GetBodyInertia] Could not determine leg type");
double GetBodyMass(BodyType _body)
Eigen::Matrix< double, 3, 18 > GetTranslationJacobianInW(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetTranslationJacobianInW function returns the 3x18 spatial translation Jacobian mapping generali...
double L3
Leg (Fibula & Tibia) link length.
Eigen::Matrix< double, Eigen::Dynamic, 18 > GetContactJacobianInW(std::vector< LegType > &_legs, const Eigen::Matrix< double, 18, 1 > &_q)
The GetContactJacobianInW function returns the (3*n_c)x18 support Jacobian mapping reaction forces at...
Eigen::Matrix< double, 18, 18 > GetMassMatrix(const Eigen::Matrix< double, 18, 1 > &_q)
The GetMassMatrix function returns the mass matrix for the floating base system.
bool SolveInverseKinematics(const Twist &_q_b, const FootstepPositions &_f_pos, JointSpaceVector &_q_r)
The SolveInverseKinematics function calculates the Inverse Kinematics, i.e. maps a coordinate point i...
Eigen::Matrix< double, 3, 3 > GetRotationMatrixWToB(const double &_roll, const double &_pitch, const double &_yaw)
The GetRotationMatrixWToB function returns the Euler Angles ZYX rotation matrix from World to Body fr...
Eigen::Matrix< double, 18, 1 > GetSingleBodyCoriolisAndCentrifugalTerms(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetSingleBodyCoriolisAndCentrifugalTerms function returns the coriolis and centrifugal terms for ...
bool frOffset
Front Right offset.
bool ValidateSolution(const JointSpaceVector &_q_r)
The ValidateSolution function evaluates whether a set of joint angles is within joint limits.
Eigen::Matrix< double, 3, 3 > GetSingleLegMassMatrix(const Eigen::Matrix< double, 3, 1 > &_q)
Vector3d SolveSingleLegHipToFootForwardKinematics(const LegType &_leg_type, const Vector3d &_joint_angles)
The SolveSingleLegHipToFootForwardKinematics function calculates the foot position in the hip frame.
Eigen::Matrix< double, 3, 18 > GetTranslationJacobianInCDiff(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetTranslationJacobianInCDiff function returns the time derivative of the 3x18 spatial translatio...
Eigen::Matrix< double, 3, 18 > GetRotationJacobianInWDiff(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetRotationJacobianInWDiff function returns the time derivative of the 3x18 spatial Rotation Jaco...
BodyType
Body type enumerator.
Eigen::Matrix< double, 3, 3 > GetRotationMatrixWToC(const double &_roll, const double &_pitch, const double &_yaw)
The GetRotationMatrixWToC function returns the Euler Angles ZYX rotation matrix from World to Control...
Vector3d positionBaseToFrontLeftInB
Position vector relating the base coordinates to the front left hip.
TransMatrix GetDhTransform(const double &_a, const double &_alpha, const double &_d, const double &_theta)
The GetDhTransform function returns the Denavit-Hartenberg transformation from frame A to frame B.
TransMatrix GetHipToBodyTransform(const LegType &_leg, const BodyType &_body, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp)
The GetHipToBodyTransform function returns the homogeneous transformation from the hip frame to the s...
bool rrOffset
Rear Right offset.
Vector3d positionBaseToRearLeftInB
Position vector relating the base coordinates to the rear left hip.
Eigen::Matrix< double, 3, 3 > I3
Leg link inertia matrix.
Eigen::Matrix< double, Eigen::Dynamic, 18 > GetSwingJacobianInW(std::vector< LegType > &_legs, const Eigen::Matrix< double, 18, 1 > &_q)
The GetSwingJacobianInW function returns the (3*n_s)x18 support Jacobian mapping swing foot velocitie...
double LC2
Hip pitch joint to thigh CoM length.
Eigen::Matrix< double, 3, 3 > GetRotationJacobianInBDiff(const LegType &_leg, const BodyType &_body, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp, const double &_dot_theta_hy, const double &_dot_theta_hp, const double &_dot_theta_kp)
The GetRotationJacobianInBDiff function returns the time derivative of the 3x3 Rotation Jacobian matr...
virtual ~Kinematics()
Destructor.
bool rlOffset
Rear Left offset.
Eigen::Matrix< double, 18, 1 > GetSingleBodyGravitationalTerms(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetSingleBodyGravitationalTerms function returns the gravitational terms for a single body in the...
Eigen::Matrix< double, 3, 3 > GetTranslationJacobianInB(const LegType &_leg, const BodyType &_body, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp)
The GetTranslationJacobianInB function returns the 3x3 Jacobian matrix for body linear velocities in ...
Eigen::Matrix< double, 3, 3 > GetInertiaMatrix(const double &_I_XX, const double &_I_YY, const double &_I_ZZ, const double &_I_XY, const double &_I_XZ, const double &_I_YZ)
The GetInertiaMatrix function returns the inertia matrix from the six inertial parameters.
JointSpaceVector max_angles
Maximum joint limits.
Eigen::Matrix< double, 6, 18 > GetJacobianInW(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetJacobianInW function returns the 6x18 spatial Jacobian mapping generalized velocities to opera...
Eigen::Matrix< double, 3, 3 > GetRotationJacobianInB(const LegType &_leg, const BodyType &_body, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp)
The GetRotationJacobianInB function returns the 3x3 Jacobian matrix for body angular velocities in th...
Eigen::Matrix< double, 3, 1 > GetSingleLegCoriolisAndCentrifugalTerms(const Eigen::Matrix< double, 3, 1 > &_q, const Eigen::Matrix< double, 3, 1 > &_u)
double LC3
Knee pitch joint to leg CoM length.
Vector3d SolveSingleLegForwardKinematics(const Vector3d &_h_pos, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp)
The SolveSingleLegForwardKinematics function calculates the Forward Kinematics for a single leg.
Vector3d positionBaseToRearRightInB
Position vector relating the base coordinates to the rear right hip.
Eigen::Matrix< double, 3, 3 > I0
Body link inertia matrix.
Eigen::Matrix< double, 3, 3 > GetTranslationJacobianInBDiff(const LegType &_leg, const BodyType &_body, const double &_theta_hy, const double &_theta_hp, const double &_theta_kp, const double &_dot_theta_hy, const double &_dot_theta_hp, const double &_dot_theta_kp)
The GetTranslationJacobianDerivativeInB function returns the time derivative of the 3x3 translation J...
Eigen::Matrix< double, 3, 3 > I1_fr_rl
Front Right & Rear Left Hip link inertia matrix.
bool SolveForwardKinematics(const GeneralizedCoordinates &_q, FootstepPositions &_f_pos)
The SolveForwardKinematics function calculates the Forward Kinematics, i.e. maps joint angles in Join...
Eigen::Matrix< double, 3, 3 > GetRotationMatrixCToB(const double &_roll, const double &_pitch, const double &_yaw)
The GetRotationMatrixCToB function returns the Euler Angles ZYX rotation matrix from Control to Body ...
Eigen::Matrix< double, 18, 1 > GetGravitationalTerms(const Eigen::Matrix< double, 18, 1 > &_q)
The GetGravitationalTerms function returns the gravitational terms for the floating base system.
Eigen::Matrix< double, Eigen::Dynamic, 18 > GetContactJacobianInWDiff(std::vector< LegType > &_legs, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetContactJacobianInWDiff function returns the time derivative of the (3*n_c)x18 support Jacobian...
double L2
Thigh (Femur) link length.
double M2
Thigh link mass.
Eigen::Matrix< double, 18, 18 > GetSingleBodyMassMatrix(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetSingleBodyMassMatrix function returns the mass matrix for a single body in the system.
Eigen::Matrix< double, 3, 3 > GetBodyInertia(BodyType _body)
Eigen::Matrix< double, 3, 18 > GetTranslationJacobianInC(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetTranslationJacobianInC function returns the 3x18 spatial translation Jacobian mapping generali...
Eigen::Matrix< double, 3, 1 > GetPositionBaseToBodyInB(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetPositionBaseToBodyInB returns the position vector from base origin to COM position in body-fra...
Eigen::Matrix< double, 3, 18 > GetRotationJacobianInC(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetRotationJacobianInC function returns the 3x18 spatial rotation Jacobian mapping generalized ve...
Vector3d positionBaseToFrontRightInB
Position vector relating the base coordinates to the front right hip.
bool flOffset
Front Left offset.
JointSpaceVector min_angles
Minimum joint limits.
Eigen::Matrix< double, 3, 3 > I1_fl_rr
Front Left & Rear Right Hip link inertia matrix.
Eigen::Matrix< double, 3, 3 > I2
Thigh link inertia matrix.
bool SolveSingleLegInverseKinematics(const bool &_offset, const Vector3d &_h_pos, const Vector3d &_f_pos, Vector3d &_joint_angles)
The SolveSingeLegInverseKinematics function calculates the inverse kinematics for a single leg.
Eigen::Matrix< double, 3, 3 > GetRotationMatrixCToBDiff(const double &_roll, const double &_pitch, const double &_yaw, const double &_roll_rate, const double &_pitch_rate, const double &_yaw_rate)
The GetRotationMatrixCToBDiff function returns the time derivative of the Euler Angles ZYX rotation m...
Eigen::Matrix< double, 3, 3 > GetRotationMatrixWToCDiff(const double &_roll, const double &_pitch, const double &_yaw, const double &_roll_rate, const double &_pitch_rate, const double &_yaw_rate)
The GetRotationMatrixWToCDiff function returns the time derivative of the Euler Angles ZYX rotation m...
Eigen::Matrix< double, 3, 18 > GetRotationJacobianInCDiff(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetRotationJacobianInCDiff function returns the time derivative of the 3x18 control frame Rotatio...
Eigen::Matrix< double, 3, 3 > GetRotationMatrixWToBDiff(const double &_roll, const double &_pitch, const double &_yaw, const double &_roll_rate, const double &_pitch_rate, const double &_yaw_rate)
The GetRotationMatrixWToBDiff function returns the time derivative of the Euler Angles ZYX rotation m...
Eigen::Matrix< double, 3, 18 > GetTranslationJacobianInWDiff(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetTranslationJacobianInWDiff function returns the time derivative of the 3x18 spatial translatio...
Eigen::Matrix< double, Eigen::Dynamic, 18 > GetSwingJacobianInWDiff(std::vector< LegType > &_legs, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetContactJacobianInWDiff function returns the time derivative of the (3*n_s)x18 support Jacobian...
Eigen::Matrix< double, 3, 18 > GetRotationJacobianInW(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q)
The GetRotationJacobianInW function returns the 3x18 spatial rotation Jacobian mapping generalized ve...
Eigen::Matrix< double, 6, 18 > GetJacobianInWDiff(const LegType &_leg, const BodyType &_body, const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetJacobianInW function returns the time derivative of the 6x18 spatial Jacobian.
LegType
Leg type enumerator.
double L1
Hip link length.
Eigen::Matrix< double, 3, 1 > GetSingleLegGravitationalTerms(const Eigen::Matrix< double, 3, 1 > &_q)
double LC1
Hip yaw joint to hip CoM length.
Eigen::Matrix< double, 18, 1 > GetCoriolisAndCentrifugalTerms(const Eigen::Matrix< double, 18, 1 > &_q, const Eigen::Matrix< double, 18, 1 > &_u)
The GetCoriolisAndCentrifugalTerms function returns the coriolis and centrifugal terms for the floati...
Eigen::Matrix< double, 18, 1 > GeneralizedCoordinates
Eigen::Matrix< double, 12, 1 > JointSpaceVector
Eigen::Matrix< Eigen::Vector3d, 4, 1 > FootstepPositions
kindr::HomTransformMatrixD TransMatrix
Eigen::Matrix< double, 6, 1 > Twist
static constexpr double HALF_PI
Define PI/2.
double degToRad(const double &_deg)
The degToRad function converts degrees to radians.
static constexpr double PI
Define PI.