3 template <
typename TRAIT>
7 template <
typename TRAIT>
9 inertiaProps( & inertia ),
11 Shoulder_AA_I(inertiaProps->getTensor_Shoulder_AA() ),
12 Shoulder_FE_I(inertiaProps->getTensor_Shoulder_FE() ),
13 Humerus_R_I(inertiaProps->getTensor_Humerus_R() ),
14 Elbow_FE_I(inertiaProps->getTensor_Elbow_FE() ),
15 Wrist_R_I(inertiaProps->getTensor_Wrist_R() ),
16 Wrist_FE_I(inertiaProps->getTensor_Wrist_FE() )
18 #ifndef EIGEN_NO_DEBUG 19 std::cout <<
"Robot ct_HyA, InverseDynamics<TRAIT>::InverseDynamics()" << std::endl;
20 std::cout <<
"Compiled with Eigen debug active" << std::endl;
22 Shoulder_AA_v.setZero();
23 Shoulder_FE_v.setZero();
24 Humerus_R_v.setZero();
32 template <
typename TRAIT>
42 template <
typename TRAIT>
46 Shoulder_AA_a = (xm->fr_Shoulder_AA_X_fr_HyABase).col(
iit::rbd::LZ) *
SCALAR(iit::rbd::g);
47 Shoulder_AA_f = Shoulder_AA_I * Shoulder_AA_a;
49 Shoulder_FE_a = (xm->fr_Shoulder_FE_X_fr_Shoulder_AA) * Shoulder_AA_a;
50 Shoulder_FE_f = Shoulder_FE_I * Shoulder_FE_a;
52 Humerus_R_a = (xm->fr_Humerus_R_X_fr_Shoulder_FE) * Shoulder_FE_a;
53 Humerus_R_f = Humerus_R_I * Humerus_R_a;
55 Elbow_FE_a = (xm->fr_Elbow_FE_X_fr_Humerus_R) * Humerus_R_a;
56 Elbow_FE_f = Elbow_FE_I * Elbow_FE_a;
58 Wrist_R_a = (xm->fr_Wrist_R_X_fr_Elbow_FE) * Elbow_FE_a;
59 Wrist_R_f = Wrist_R_I * Wrist_R_a;
61 Wrist_FE_a = (xm->fr_Wrist_FE_X_fr_Wrist_R) * Wrist_R_a;
62 Wrist_FE_f = Wrist_FE_I * Wrist_FE_a;
67 template <
typename TRAIT>
76 Shoulder_FE_v = ((xm->fr_Shoulder_FE_X_fr_Shoulder_AA) * Shoulder_AA_v);
79 iit::rbd::motionCrossProductMx<SCALAR>(Shoulder_FE_v, vcross);
83 Shoulder_FE_f = Shoulder_FE_I * Shoulder_FE_a +
iit::rbd::vxIv(Shoulder_FE_v, Shoulder_FE_I);
86 Humerus_R_v = ((xm->fr_Humerus_R_X_fr_Shoulder_FE) * Shoulder_FE_v);
89 iit::rbd::motionCrossProductMx<SCALAR>(Humerus_R_v, vcross);
91 Humerus_R_a = (xm->fr_Humerus_R_X_fr_Shoulder_FE) * Shoulder_FE_a + vcross.col(
iit::rbd::AZ) * qd(
HR);
93 Humerus_R_f = Humerus_R_I * Humerus_R_a +
iit::rbd::vxIv(Humerus_R_v, Humerus_R_I);
96 Elbow_FE_v = ((xm->fr_Elbow_FE_X_fr_Humerus_R) * Humerus_R_v);
99 iit::rbd::motionCrossProductMx<SCALAR>(Elbow_FE_v, vcross);
101 Elbow_FE_a = (xm->fr_Elbow_FE_X_fr_Humerus_R) * Humerus_R_a + vcross.col(
iit::rbd::AZ) * qd(
EFE);
103 Elbow_FE_f = Elbow_FE_I * Elbow_FE_a +
iit::rbd::vxIv(Elbow_FE_v, Elbow_FE_I);
106 Wrist_R_v = ((xm->fr_Wrist_R_X_fr_Elbow_FE) * Elbow_FE_v);
109 iit::rbd::motionCrossProductMx<SCALAR>(Wrist_R_v, vcross);
111 Wrist_R_a = (xm->fr_Wrist_R_X_fr_Elbow_FE) * Elbow_FE_a + vcross.col(
iit::rbd::AZ) * qd(
WR);
113 Wrist_R_f = Wrist_R_I * Wrist_R_a +
iit::rbd::vxIv(Wrist_R_v, Wrist_R_I);
116 Wrist_FE_v = ((xm->fr_Wrist_FE_X_fr_Wrist_R) * Wrist_R_v);
119 iit::rbd::motionCrossProductMx<SCALAR>(Wrist_FE_v, vcross);
121 Wrist_FE_a = (xm->fr_Wrist_FE_X_fr_Wrist_R) * Wrist_R_a + vcross.col(
iit::rbd::AZ) * qd(
WFE);
123 Wrist_FE_f = Wrist_FE_I * Wrist_FE_a +
iit::rbd::vxIv(Wrist_FE_v, Wrist_FE_I);
129 template <
typename TRAIT>
133 Shoulder_AA_a = (xm->fr_Shoulder_AA_X_fr_HyABase).col(
iit::rbd::LZ) *
SCALAR(iit::rbd::g);
140 Shoulder_FE_v = ((xm->fr_Shoulder_FE_X_fr_Shoulder_AA) * Shoulder_AA_v);
143 iit::rbd::motionCrossProductMx<SCALAR>(Shoulder_FE_v, vcross);
145 Shoulder_FE_a = (xm->fr_Shoulder_FE_X_fr_Shoulder_AA) * Shoulder_AA_a + vcross.col(
iit::rbd::AZ) * qd(
SFE);
151 Humerus_R_v = ((xm->fr_Humerus_R_X_fr_Shoulder_FE) * Shoulder_FE_v);
154 iit::rbd::motionCrossProductMx<SCALAR>(Humerus_R_v, vcross);
156 Humerus_R_a = (xm->fr_Humerus_R_X_fr_Shoulder_FE) * Shoulder_FE_a + vcross.col(
iit::rbd::AZ) * qd(
HR);
162 Elbow_FE_v = ((xm->fr_Elbow_FE_X_fr_Humerus_R) * Humerus_R_v);
165 iit::rbd::motionCrossProductMx<SCALAR>(Elbow_FE_v, vcross);
167 Elbow_FE_a = (xm->fr_Elbow_FE_X_fr_Humerus_R) * Humerus_R_a + vcross.col(
iit::rbd::AZ) * qd(
EFE);
173 Wrist_R_v = ((xm->fr_Wrist_R_X_fr_Elbow_FE) * Elbow_FE_v);
176 iit::rbd::motionCrossProductMx<SCALAR>(Wrist_R_v, vcross);
178 Wrist_R_a = (xm->fr_Wrist_R_X_fr_Elbow_FE) * Elbow_FE_a + vcross.col(
iit::rbd::AZ) * qd(
WR);
184 Wrist_FE_v = ((xm->fr_Wrist_FE_X_fr_Wrist_R) * Wrist_R_v);
187 iit::rbd::motionCrossProductMx<SCALAR>(Wrist_FE_v, vcross);
189 Wrist_FE_a = (xm->fr_Wrist_FE_X_fr_Wrist_R) * Wrist_R_a + vcross.col(
iit::rbd::AZ) * qd(
WFE);
196 template <
typename TRAIT>
201 Wrist_R_f += xm->fr_Wrist_FE_X_fr_Wrist_R.transpose() * Wrist_FE_f;
204 Elbow_FE_f += xm->fr_Wrist_R_X_fr_Elbow_FE.transpose() * Wrist_R_f;
207 Humerus_R_f += xm->fr_Elbow_FE_X_fr_Humerus_R.transpose() * Elbow_FE_f;
210 Shoulder_FE_f += xm->fr_Humerus_R_X_fr_Shoulder_FE.transpose() * Humerus_R_f;
213 Shoulder_AA_f += xm->fr_Shoulder_FE_X_fr_Shoulder_AA.transpose() * Shoulder_FE_f;
Definition: declarations.h:27
Definition: declarations.h:30
Definition: declarations.h:39
Force< DScalar > vxIv(const Velocity< DScalar > &v, const MatrixBase< Derived > &I)
Definition: inverse_dynamics.h:43
InverseDynamics(IProperties &in, MTransforms &tr)
Definition: inverse_dynamics.impl.h:8
Definition: declarations.h:29
Definition: declarations.h:42
Definition: link_data_map.h:12
void id(JointState &jForces, const JointState &q, const JointState &qd, const JointState &qdd, const ExtForces &fext=zeroExtForces)
Definition: inverse_dynamics.h:220
Definition: declarations.h:41
Definition: declarations.h:38
void C_terms(JointState &jForces, const JointState &q, const JointState &qd)
Definition: inverse_dynamics.h:213
Definition: declarations.h:31
Definition: declarations.h:28
void firstPass(const JointState &qd, const JointState &qdd, const ExtForces &fext)
Definition: inverse_dynamics.impl.h:130
void G_terms(JointState &jForces, const JointState &q)
Definition: inverse_dynamics.h:206
Definition: declarations.h:37
Definition: declarations.h:32
Definition: declarations.h:40
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef TRAIT::Scalar SCALAR
Definition: inverse_dynamics.h:47
void secondPass(JointState &jForces)
Definition: inverse_dynamics.impl.h:197
iit::ct_HyA::tpl::JointState< SCALAR > JointState
Definition: inverse_dynamics.h:56
iit::ct_HyA::tpl::MotionTransforms< TRAIT > MTransforms
Definition: inverse_dynamics.h:58
Definition: inertia_properties.h:26