3 template <
typename TRAIT>
7 template <
typename TRAIT>
9 inertiaProps( & inertia ),
10 motionTransforms( & transforms )
12 LF_hipassembly_v.setZero();
13 LF_hipassembly_c.setZero();
14 LF_upperleg_v.setZero();
15 LF_upperleg_c.setZero();
16 LF_lowerleg_v.setZero();
17 LF_lowerleg_c.setZero();
18 RF_hipassembly_v.setZero();
19 RF_hipassembly_c.setZero();
20 RF_upperleg_v.setZero();
21 RF_upperleg_c.setZero();
22 RF_lowerleg_v.setZero();
23 RF_lowerleg_c.setZero();
24 LH_hipassembly_v.setZero();
25 LH_hipassembly_c.setZero();
26 LH_upperleg_v.setZero();
27 LH_upperleg_c.setZero();
28 LH_lowerleg_v.setZero();
29 LH_lowerleg_c.setZero();
30 RH_hipassembly_v.setZero();
31 RH_hipassembly_c.setZero();
32 RH_upperleg_v.setZero();
33 RH_upperleg_c.setZero();
34 RH_lowerleg_v.setZero();
35 RH_lowerleg_c.setZero();
42 template <
typename TRAIT>
53 trunk_AI = inertiaProps->getTensor_trunk();
54 trunk_p = - fext[
TRUNK];
55 LF_hipassembly_AI = inertiaProps->getTensor_LF_hipassembly();
57 LF_upperleg_AI = inertiaProps->getTensor_LF_upperleg();
59 LF_lowerleg_AI = inertiaProps->getTensor_LF_lowerleg();
61 RF_hipassembly_AI = inertiaProps->getTensor_RF_hipassembly();
63 RF_upperleg_AI = inertiaProps->getTensor_RF_upperleg();
65 RF_lowerleg_AI = inertiaProps->getTensor_RF_lowerleg();
67 LH_hipassembly_AI = inertiaProps->getTensor_LH_hipassembly();
69 LH_upperleg_AI = inertiaProps->getTensor_LH_upperleg();
71 LH_lowerleg_AI = inertiaProps->getTensor_LH_lowerleg();
73 RH_hipassembly_AI = inertiaProps->getTensor_RH_hipassembly();
75 RH_upperleg_AI = inertiaProps->getTensor_RH_upperleg();
77 RH_lowerleg_AI = inertiaProps->getTensor_RH_lowerleg();
87 LF_hipassembly_v = (motionTransforms-> fr_LF_hipassembly_X_fr_trunk) * trunk_v;
91 iit::rbd::motionCrossProductMx<Scalar>(LF_hipassembly_v, vcross);
95 LF_hipassembly_p +=
iit::rbd::vxIv(LF_hipassembly_v, LF_hipassembly_AI);
99 LF_upperleg_v = (motionTransforms-> fr_LF_upperleg_X_fr_LF_hipassembly) * LF_hipassembly_v;
103 iit::rbd::motionCrossProductMx<Scalar>(LF_upperleg_v, vcross);
111 LF_lowerleg_v = (motionTransforms-> fr_LF_lowerleg_X_fr_LF_upperleg) * LF_upperleg_v;
115 iit::rbd::motionCrossProductMx<Scalar>(LF_lowerleg_v, vcross);
123 RF_hipassembly_v = (motionTransforms-> fr_RF_hipassembly_X_fr_trunk) * trunk_v;
127 iit::rbd::motionCrossProductMx<Scalar>(RF_hipassembly_v, vcross);
131 RF_hipassembly_p +=
iit::rbd::vxIv(RF_hipassembly_v, RF_hipassembly_AI);
135 RF_upperleg_v = (motionTransforms-> fr_RF_upperleg_X_fr_RF_hipassembly) * RF_hipassembly_v;
139 iit::rbd::motionCrossProductMx<Scalar>(RF_upperleg_v, vcross);
147 RF_lowerleg_v = (motionTransforms-> fr_RF_lowerleg_X_fr_RF_upperleg) * RF_upperleg_v;
151 iit::rbd::motionCrossProductMx<Scalar>(RF_lowerleg_v, vcross);
159 LH_hipassembly_v = (motionTransforms-> fr_LH_hipassembly_X_fr_trunk) * trunk_v;
163 iit::rbd::motionCrossProductMx<Scalar>(LH_hipassembly_v, vcross);
167 LH_hipassembly_p +=
iit::rbd::vxIv(LH_hipassembly_v, LH_hipassembly_AI);
171 LH_upperleg_v = (motionTransforms-> fr_LH_upperleg_X_fr_LH_hipassembly) * LH_hipassembly_v;
175 iit::rbd::motionCrossProductMx<Scalar>(LH_upperleg_v, vcross);
183 LH_lowerleg_v = (motionTransforms-> fr_LH_lowerleg_X_fr_LH_upperleg) * LH_upperleg_v;
187 iit::rbd::motionCrossProductMx<Scalar>(LH_lowerleg_v, vcross);
195 RH_hipassembly_v = (motionTransforms-> fr_RH_hipassembly_X_fr_trunk) * trunk_v;
199 iit::rbd::motionCrossProductMx<Scalar>(RH_hipassembly_v, vcross);
203 RH_hipassembly_p +=
iit::rbd::vxIv(RH_hipassembly_v, RH_hipassembly_AI);
207 RH_upperleg_v = (motionTransforms-> fr_RH_upperleg_X_fr_RH_hipassembly) * RH_hipassembly_v;
211 iit::rbd::motionCrossProductMx<Scalar>(RH_upperleg_v, vcross);
219 RH_lowerleg_v = (motionTransforms-> fr_RH_lowerleg_X_fr_RH_upperleg) * RH_upperleg_v;
223 iit::rbd::motionCrossProductMx<Scalar>(RH_lowerleg_v, vcross);
242 pa = RH_lowerleg_p + Ia_r * RH_lowerleg_c + RH_lowerleg_U * RH_lowerleg_u/RH_lowerleg_D;
244 RH_upperleg_AI += IaB;
245 RH_upperleg_p += (motionTransforms-> fr_RH_lowerleg_X_fr_RH_upperleg).transpose() * pa;
253 pa = RH_upperleg_p + Ia_r * RH_upperleg_c + RH_upperleg_U * RH_upperleg_u/RH_upperleg_D;
255 RH_hipassembly_AI += IaB;
256 RH_hipassembly_p += (motionTransforms-> fr_RH_upperleg_X_fr_RH_hipassembly).transpose() * pa;
264 pa = RH_hipassembly_p + Ia_r * RH_hipassembly_c + RH_hipassembly_U * RH_hipassembly_u/RH_hipassembly_D;
267 trunk_p += (motionTransforms-> fr_RH_hipassembly_X_fr_trunk).transpose() * pa;
275 pa = LH_lowerleg_p + Ia_r * LH_lowerleg_c + LH_lowerleg_U * LH_lowerleg_u/LH_lowerleg_D;
277 LH_upperleg_AI += IaB;
278 LH_upperleg_p += (motionTransforms-> fr_LH_lowerleg_X_fr_LH_upperleg).transpose() * pa;
286 pa = LH_upperleg_p + Ia_r * LH_upperleg_c + LH_upperleg_U * LH_upperleg_u/LH_upperleg_D;
288 LH_hipassembly_AI += IaB;
289 LH_hipassembly_p += (motionTransforms-> fr_LH_upperleg_X_fr_LH_hipassembly).transpose() * pa;
297 pa = LH_hipassembly_p + Ia_r * LH_hipassembly_c + LH_hipassembly_U * LH_hipassembly_u/LH_hipassembly_D;
300 trunk_p += (motionTransforms-> fr_LH_hipassembly_X_fr_trunk).transpose() * pa;
308 pa = RF_lowerleg_p + Ia_r * RF_lowerleg_c + RF_lowerleg_U * RF_lowerleg_u/RF_lowerleg_D;
310 RF_upperleg_AI += IaB;
311 RF_upperleg_p += (motionTransforms-> fr_RF_lowerleg_X_fr_RF_upperleg).transpose() * pa;
319 pa = RF_upperleg_p + Ia_r * RF_upperleg_c + RF_upperleg_U * RF_upperleg_u/RF_upperleg_D;
321 RF_hipassembly_AI += IaB;
322 RF_hipassembly_p += (motionTransforms-> fr_RF_upperleg_X_fr_RF_hipassembly).transpose() * pa;
330 pa = RF_hipassembly_p + Ia_r * RF_hipassembly_c + RF_hipassembly_U * RF_hipassembly_u/RF_hipassembly_D;
333 trunk_p += (motionTransforms-> fr_RF_hipassembly_X_fr_trunk).transpose() * pa;
341 pa = LF_lowerleg_p + Ia_r * LF_lowerleg_c + LF_lowerleg_U * LF_lowerleg_u/LF_lowerleg_D;
343 LF_upperleg_AI += IaB;
344 LF_upperleg_p += (motionTransforms-> fr_LF_lowerleg_X_fr_LF_upperleg).transpose() * pa;
352 pa = LF_upperleg_p + Ia_r * LF_upperleg_c + LF_upperleg_U * LF_upperleg_u/LF_upperleg_D;
354 LF_hipassembly_AI += IaB;
355 LF_hipassembly_p += (motionTransforms-> fr_LF_upperleg_X_fr_LF_hipassembly).transpose() * pa;
363 pa = LF_hipassembly_p + Ia_r * LF_hipassembly_c + LF_hipassembly_U * LF_hipassembly_u/LF_hipassembly_D;
366 trunk_p += (motionTransforms-> fr_LF_hipassembly_X_fr_trunk).transpose() * pa;
369 trunk_a = - TRAIT::solve(trunk_AI, trunk_p);
372 LF_hipassembly_a = (motionTransforms-> fr_LF_hipassembly_X_fr_trunk) * trunk_a + LF_hipassembly_c;
373 qdd(
LF_HAA) = (LF_hipassembly_u - LF_hipassembly_U.dot(LF_hipassembly_a)) / LF_hipassembly_D;
376 LF_upperleg_a = (motionTransforms-> fr_LF_upperleg_X_fr_LF_hipassembly) * LF_hipassembly_a + LF_upperleg_c;
377 qdd(
LF_HFE) = (LF_upperleg_u - LF_upperleg_U.dot(LF_upperleg_a)) / LF_upperleg_D;
380 LF_lowerleg_a = (motionTransforms-> fr_LF_lowerleg_X_fr_LF_upperleg) * LF_upperleg_a + LF_lowerleg_c;
381 qdd(
LF_KFE) = (LF_lowerleg_u - LF_lowerleg_U.dot(LF_lowerleg_a)) / LF_lowerleg_D;
384 RF_hipassembly_a = (motionTransforms-> fr_RF_hipassembly_X_fr_trunk) * trunk_a + RF_hipassembly_c;
385 qdd(
RF_HAA) = (RF_hipassembly_u - RF_hipassembly_U.dot(RF_hipassembly_a)) / RF_hipassembly_D;
388 RF_upperleg_a = (motionTransforms-> fr_RF_upperleg_X_fr_RF_hipassembly) * RF_hipassembly_a + RF_upperleg_c;
389 qdd(
RF_HFE) = (RF_upperleg_u - RF_upperleg_U.dot(RF_upperleg_a)) / RF_upperleg_D;
392 RF_lowerleg_a = (motionTransforms-> fr_RF_lowerleg_X_fr_RF_upperleg) * RF_upperleg_a + RF_lowerleg_c;
393 qdd(
RF_KFE) = (RF_lowerleg_u - RF_lowerleg_U.dot(RF_lowerleg_a)) / RF_lowerleg_D;
396 LH_hipassembly_a = (motionTransforms-> fr_LH_hipassembly_X_fr_trunk) * trunk_a + LH_hipassembly_c;
397 qdd(
LH_HAA) = (LH_hipassembly_u - LH_hipassembly_U.dot(LH_hipassembly_a)) / LH_hipassembly_D;
400 LH_upperleg_a = (motionTransforms-> fr_LH_upperleg_X_fr_LH_hipassembly) * LH_hipassembly_a + LH_upperleg_c;
401 qdd(
LH_HFE) = (LH_upperleg_u - LH_upperleg_U.dot(LH_upperleg_a)) / LH_upperleg_D;
404 LH_lowerleg_a = (motionTransforms-> fr_LH_lowerleg_X_fr_LH_upperleg) * LH_upperleg_a + LH_lowerleg_c;
405 qdd(
LH_KFE) = (LH_lowerleg_u - LH_lowerleg_U.dot(LH_lowerleg_a)) / LH_lowerleg_D;
408 RH_hipassembly_a = (motionTransforms-> fr_RH_hipassembly_X_fr_trunk) * trunk_a + RH_hipassembly_c;
409 qdd(
RH_HAA) = (RH_hipassembly_u - RH_hipassembly_U.dot(RH_hipassembly_a)) / RH_hipassembly_D;
412 RH_upperleg_a = (motionTransforms-> fr_RH_upperleg_X_fr_RH_hipassembly) * RH_hipassembly_a + RH_upperleg_c;
413 qdd(
RH_HFE) = (RH_upperleg_u - RH_upperleg_U.dot(RH_upperleg_a)) / RH_upperleg_D;
416 RH_lowerleg_a = (motionTransforms-> fr_RH_lowerleg_X_fr_RH_upperleg) * RH_upperleg_a + RH_lowerleg_c;
417 qdd(
RH_KFE) = (RH_lowerleg_u - RH_lowerleg_U.dot(RH_lowerleg_a)) / RH_lowerleg_D;
Definition: declarations.h:54
Definition: declarations.h:31
ForwardDynamics(iit::HyQ::dyn::tpl::InertiaProperties< TRAIT > &in, MTransforms &tr)
Definition: forward_dynamics.impl.h:8
void compute_Ia_revolute(const MatrixBase< D1 > &IA, const Vec6< typename D1::Scalar > &U, const typename D1::Scalar &D, const MatrixBase< D2 > &Ia_const)
Definition: declarations.h:36
Definition: declarations.h:29
Definition: declarations.h:42
Definition: link_data_map.h:12
Force< DScalar > vxIv(const Velocity< DScalar > &v, const MatrixBase< Derived > &I)
Definition: declarations.h:34
Definition: declarations.h:37
Definition: declarations.h:28
Definition: declarations.h:50
Definition: declarations.h:48
Definition: declarations.h:38
Definition: declarations.h:35
CoreS::VelocityVector Velocity
Definition: forward_dynamics.h:46
Definition: inertia_properties.h:26
Definition: declarations.h:43
Definition: declarations.h:27
Definition: declarations.h:53
Definition: declarations.h:33
Definition: declarations.h:32
Definition: declarations.h:51
Definition: declarations.h:47
Definition: forward_dynamics.h:35
void fd(JointState &qdd, Acceleration &trunk_a, const Velocity &trunk_v, const Acceleration &g, const JointState &q, const JointState &qd, const JointState &tau, const ExtForces &fext=zeroExtForces)
Definition: forward_dynamics.h:244
Definition: declarations.h:49
iit::HyQ::tpl::MotionTransforms< TRAIT > MTransforms
Definition: forward_dynamics.h:53
CoreS::VelocityVector Acceleration
Definition: forward_dynamics.h:47
Definition: declarations.h:46
CoreS::Matrix66 Matrix66S
Definition: forward_dynamics.h:50
Definition: declarations.h:44
Definition: declarations.h:52
void ctransform_Ia_revolute(const MatrixBase< D1 > &Ia_A, const MatrixBase< D2 > &XM, const MatrixBase< D3 > &Ia_B_const)
Definition: declarations.h:45
iit::HyQ::tpl::JointState< Scalar > JointState
Definition: forward_dynamics.h:49
CoreS::ForceVector Force
Definition: forward_dynamics.h:44
Definition: declarations.h:30