48 using Twist = Eigen::Matrix<double, 6, 1>;
99 const double &_theta_hy,
100 const double &_theta_hp,
101 const double &_theta_kp);
164 const double &_alpha,
166 const double &_theta);
178 const double &_theta_hy,
179 const double &_theta_hp,
180 const double &_theta_kp);
191 const double &_pitch,
206 const double &_pitch,
208 const double &_roll_rate,
209 const double &_pitch_rate,
210 const double &_yaw_rate);
222 const double &_pitch,
237 const double &_pitch,
239 const double &_roll_rate,
240 const double &_pitch_rate,
241 const double &_yaw_rate);
253 const double &_pitch,
268 const double &_pitch,
270 const double &_roll_rate,
271 const double &_pitch_rate,
272 const double &_yaw_rate);
283 const Eigen::Matrix<double, 18, 1> &_q);
297 const double &_theta_hy,
298 const double &_theta_hp,
299 const double &_theta_kp);
311 const Eigen::Matrix<double, 12, 1> &_q_r);
323 const Eigen::Matrix<double, 18, 1> &_q);
335 const Eigen::Matrix<double, 18, 1> &_q);
350 const double &_theta_hy,
351 const double &_theta_hp,
352 const double &_theta_kp,
353 const double &_dot_theta_hy,
354 const double &_dot_theta_hp,
355 const double &_dot_theta_kp);
366 const Eigen::Matrix<double, 12, 1> &_q_r,
367 const Eigen::Matrix<double, 12, 1> &_dot_q_r);
380 const Eigen::Matrix<double, 18, 1> &_q,
381 const Eigen::Matrix<double, 18, 1> &_u);
394 const Eigen::Matrix<double, 18, 1> &_q,
395 const Eigen::Matrix<double, 18, 1> &_u);
410 const double &_theta_hy,
411 const double &_theta_hp,
412 const double &_theta_kp);
424 const Eigen::Matrix<double, 12, 1> &_q_r);
436 const Eigen::Matrix<double, 18, 1> &_q);
448 const Eigen::Matrix<double, 18, 1> &_q);
463 const double &_theta_hy,
464 const double &_theta_hp,
465 const double &_theta_kp,
466 const double &_dot_theta_hy,
467 const double &_dot_theta_hp,
468 const double &_dot_theta_kp);
479 const Eigen::Matrix<double, 12, 1> &_q_r,
480 const Eigen::Matrix<double, 12, 1> &_dot_q_r);
492 const Eigen::Matrix<double, 18, 1> &_q,
493 const Eigen::Matrix<double, 18, 1> &_u);
505 const Eigen::Matrix<double, 18, 1> &_q,
506 const Eigen::Matrix<double, 18, 1> &_u);
517 const Eigen::Matrix<double, 18, 1> &_q);
527 const Eigen::Matrix<double, 18, 1> &_q,
528 const Eigen::Matrix<double, 18, 1> &_u);
538 const Eigen::Matrix<double, 18, 1> &_q);
547 const Eigen::Matrix<double, 18, 1> &_q,
548 const Eigen::Matrix<double, 18, 1> &_u);
557 public: Eigen::Matrix<double, Eigen::Dynamic, 18>
GetSwingJacobianInW(std::vector<LegType> &_legs,
558 const Eigen::Matrix<double, 18, 1> &_q);
568 const Eigen::Matrix<double, 18, 1> &_q,
569 const Eigen::Matrix<double, 18, 1> &_u);
579 const Eigen::Matrix<double, 18, 1> &_q);
585 public: Eigen::Matrix<double, 18, 18>
GetMassMatrix(
const Eigen::Matrix<double, 18, 1> &_q);
599 const Eigen::Matrix<double, 18, 1> &_q,
600 const Eigen::Matrix<double, 18, 1> &_u);
608 const Eigen::Matrix<double, 18, 1> &_u);
612 const Eigen::Matrix<double, 3, 1> &_u);
622 const Eigen::Matrix<double, 18, 1> &_q);
656 const double &_I_YZ);
745 private: Eigen::Matrix<double, 3, 3>
I0;
754 private: Eigen::Matrix<double, 3, 3>
I2;
757 private: Eigen::Matrix<double, 3, 3>
I3;
A class for analytical Kinematics Solving.
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, 1 > GetDistanceFromBaseToRearLeftHipInB()
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.
Eigen::Matrix< double, 3, 1 > GetDistanceFromBaseToFrontLeftHipInB()
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, 1 > GetDistanceFromBaseToRearRightHipInB()
Eigen::Matrix< double, 3, 1 > GetDistanceFromBaseToFrontRightHipInB()
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