4 template <
typename TRAIT>
6 linkInertias(inertiaProperties),
7 frcTransf( &forceTransforms ),
8 LF_lowerleg_Ic(linkInertias.getTensor_LF_lowerleg()),
9 RF_lowerleg_Ic(linkInertias.getTensor_RF_lowerleg()),
10 LH_lowerleg_Ic(linkInertias.getTensor_LH_lowerleg()),
11 RH_lowerleg_Ic(linkInertias.getTensor_RH_lowerleg())
17 #define DATA tpl::JSIM<TRAIT>::operator() 18 #define Fcol(j) (tpl::JSIM<TRAIT>:: template block<6,1>(0,(j)+6)) 19 #define F(i,j) DATA((i),(j)+6) 21 template <
typename TRAIT>
25 frcTransf -> fr_RH_upperleg_X_fr_RH_lowerleg(state);
26 frcTransf -> fr_RH_hipassembly_X_fr_RH_upperleg(state);
27 frcTransf -> fr_trunk_X_fr_RH_hipassembly(state);
28 frcTransf -> fr_LH_upperleg_X_fr_LH_lowerleg(state);
29 frcTransf -> fr_LH_hipassembly_X_fr_LH_upperleg(state);
30 frcTransf -> fr_trunk_X_fr_LH_hipassembly(state);
31 frcTransf -> fr_RF_upperleg_X_fr_RF_lowerleg(state);
32 frcTransf -> fr_RF_hipassembly_X_fr_RF_upperleg(state);
33 frcTransf -> fr_trunk_X_fr_RF_hipassembly(state);
34 frcTransf -> fr_LF_upperleg_X_fr_LF_lowerleg(state);
35 frcTransf -> fr_LF_hipassembly_X_fr_LF_upperleg(state);
36 frcTransf -> fr_trunk_X_fr_LF_hipassembly(state);
52 iit::rbd::transformInertia<Scalar>(RH_lowerleg_Ic, frcTransf -> fr_RH_upperleg_X_fr_RH_lowerleg, Ic_spare);
53 RH_upperleg_Ic += Ic_spare;
67 iit::rbd::transformInertia<Scalar>(RH_upperleg_Ic, frcTransf -> fr_RH_hipassembly_X_fr_RH_upperleg, Ic_spare);
68 RH_hipassembly_Ic += Ic_spare;
79 iit::rbd::transformInertia<Scalar>(RH_hipassembly_Ic, frcTransf -> fr_trunk_X_fr_RH_hipassembly, Ic_spare);
88 iit::rbd::transformInertia<Scalar>(LH_lowerleg_Ic, frcTransf -> fr_LH_upperleg_X_fr_LH_lowerleg, Ic_spare);
89 LH_upperleg_Ic += Ic_spare;
103 iit::rbd::transformInertia<Scalar>(LH_upperleg_Ic, frcTransf -> fr_LH_hipassembly_X_fr_LH_upperleg, Ic_spare);
104 LH_hipassembly_Ic += Ic_spare;
115 iit::rbd::transformInertia<Scalar>(LH_hipassembly_Ic, frcTransf -> fr_trunk_X_fr_LH_hipassembly, Ic_spare);
116 trunk_Ic += Ic_spare;
124 iit::rbd::transformInertia<Scalar>(RF_lowerleg_Ic, frcTransf -> fr_RF_upperleg_X_fr_RF_lowerleg, Ic_spare);
125 RF_upperleg_Ic += Ic_spare;
139 iit::rbd::transformInertia<Scalar>(RF_upperleg_Ic, frcTransf -> fr_RF_hipassembly_X_fr_RF_upperleg, Ic_spare);
140 RF_hipassembly_Ic += Ic_spare;
151 iit::rbd::transformInertia<Scalar>(RF_hipassembly_Ic, frcTransf -> fr_trunk_X_fr_RF_hipassembly, Ic_spare);
152 trunk_Ic += Ic_spare;
160 iit::rbd::transformInertia<Scalar>(LF_lowerleg_Ic, frcTransf -> fr_LF_upperleg_X_fr_LF_lowerleg, Ic_spare);
161 LF_upperleg_Ic += Ic_spare;
175 iit::rbd::transformInertia<Scalar>(LF_upperleg_Ic, frcTransf -> fr_LF_hipassembly_X_fr_LF_upperleg, Ic_spare);
176 LF_hipassembly_Ic += Ic_spare;
187 iit::rbd::transformInertia<Scalar>(LF_hipassembly_Ic, frcTransf -> fr_trunk_X_fr_LF_hipassembly, Ic_spare);
188 trunk_Ic += Ic_spare;
205 template <
typename TRAIT>
207 L =
this ->
template triangularView<Eigen::Lower>();
209 L(11, 11) = std::sqrt(L(11, 11));
210 L(11, 10) = L(11, 10) / L(11, 11);
211 L(11, 9) = L(11, 9) / L(11, 11);
212 L(10, 10) = L(10, 10) - L(11, 10) * L(11, 10);
213 L(10, 9) = L(10, 9) - L(11, 10) * L(11, 9);
214 L(9, 9) = L(9, 9) - L(11, 9) * L(11, 9);
217 L(10, 10) = std::sqrt(L(10, 10));
218 L(10, 9) = L(10, 9) / L(10, 10);
219 L(9, 9) = L(9, 9) - L(10, 9) * L(10, 9);
222 L(9, 9) = std::sqrt(L(9, 9));
225 L(8, 8) = std::sqrt(L(8, 8));
226 L(8, 7) = L(8, 7) / L(8, 8);
227 L(8, 6) = L(8, 6) / L(8, 8);
228 L(7, 7) = L(7, 7) - L(8, 7) * L(8, 7);
229 L(7, 6) = L(7, 6) - L(8, 7) * L(8, 6);
230 L(6, 6) = L(6, 6) - L(8, 6) * L(8, 6);
233 L(7, 7) = std::sqrt(L(7, 7));
234 L(7, 6) = L(7, 6) / L(7, 7);
235 L(6, 6) = L(6, 6) - L(7, 6) * L(7, 6);
238 L(6, 6) = std::sqrt(L(6, 6));
241 L(5, 5) = std::sqrt(L(5, 5));
242 L(5, 4) = L(5, 4) / L(5, 5);
243 L(5, 3) = L(5, 3) / L(5, 5);
244 L(4, 4) = L(4, 4) - L(5, 4) * L(5, 4);
245 L(4, 3) = L(4, 3) - L(5, 4) * L(5, 3);
246 L(3, 3) = L(3, 3) - L(5, 3) * L(5, 3);
249 L(4, 4) = std::sqrt(L(4, 4));
250 L(4, 3) = L(4, 3) / L(4, 4);
251 L(3, 3) = L(3, 3) - L(4, 3) * L(4, 3);
254 L(3, 3) = std::sqrt(L(3, 3));
257 L(2, 2) = std::sqrt(L(2, 2));
258 L(2, 1) = L(2, 1) / L(2, 2);
259 L(2, 0) = L(2, 0) / L(2, 2);
260 L(1, 1) = L(1, 1) - L(2, 1) * L(2, 1);
261 L(1, 0) = L(1, 0) - L(2, 1) * L(2, 0);
262 L(0, 0) = L(0, 0) - L(2, 0) * L(2, 0);
265 L(1, 1) = std::sqrt(L(1, 1));
266 L(1, 0) = L(1, 0) / L(1, 1);
267 L(0, 0) = L(0, 0) - L(1, 0) * L(1, 0);
270 L(0, 0) = std::sqrt(L(0, 0));
274 template <
typename TRAIT>
278 inverse(0, 0) = + (Linv(0, 0) * Linv(0, 0));
279 inverse(1, 1) = + (Linv(1, 0) * Linv(1, 0)) + (Linv(1, 1) * Linv(1, 1));
280 inverse(1, 0) = + (Linv(1, 0) * Linv(0, 0));
281 inverse(0, 1) = inverse(1, 0);
282 inverse(2, 2) = + (Linv(2, 0) * Linv(2, 0)) + (Linv(2, 1) * Linv(2, 1)) + (Linv(2, 2) * Linv(2, 2));
283 inverse(2, 1) = + (Linv(2, 0) * Linv(1, 0)) + (Linv(2, 1) * Linv(1, 1));
284 inverse(1, 2) = inverse(2, 1);
285 inverse(2, 0) = + (Linv(2, 0) * Linv(0, 0));
286 inverse(0, 2) = inverse(2, 0);
287 inverse(3, 3) = + (Linv(3, 3) * Linv(3, 3));
288 inverse(4, 4) = + (Linv(4, 3) * Linv(4, 3)) + (Linv(4, 4) * Linv(4, 4));
289 inverse(4, 3) = + (Linv(4, 3) * Linv(3, 3));
290 inverse(3, 4) = inverse(4, 3);
291 inverse(5, 5) = + (Linv(5, 3) * Linv(5, 3)) + (Linv(5, 4) * Linv(5, 4)) + (Linv(5, 5) * Linv(5, 5));
292 inverse(5, 4) = + (Linv(5, 3) * Linv(4, 3)) + (Linv(5, 4) * Linv(4, 4));
293 inverse(4, 5) = inverse(5, 4);
294 inverse(5, 3) = + (Linv(5, 3) * Linv(3, 3));
295 inverse(3, 5) = inverse(5, 3);
296 inverse(6, 6) = + (Linv(6, 6) * Linv(6, 6));
297 inverse(7, 7) = + (Linv(7, 6) * Linv(7, 6)) + (Linv(7, 7) * Linv(7, 7));
298 inverse(7, 6) = + (Linv(7, 6) * Linv(6, 6));
299 inverse(6, 7) = inverse(7, 6);
300 inverse(8, 8) = + (Linv(8, 6) * Linv(8, 6)) + (Linv(8, 7) * Linv(8, 7)) + (Linv(8, 8) * Linv(8, 8));
301 inverse(8, 7) = + (Linv(8, 6) * Linv(7, 6)) + (Linv(8, 7) * Linv(7, 7));
302 inverse(7, 8) = inverse(8, 7);
303 inverse(8, 6) = + (Linv(8, 6) * Linv(6, 6));
304 inverse(6, 8) = inverse(8, 6);
305 inverse(9, 9) = + (Linv(9, 9) * Linv(9, 9));
306 inverse(10, 10) = + (Linv(10, 9) * Linv(10, 9)) + (Linv(10, 10) * Linv(10, 10));
307 inverse(10, 9) = + (Linv(10, 9) * Linv(9, 9));
308 inverse(9, 10) = inverse(10, 9);
309 inverse(11, 11) = + (Linv(11, 9) * Linv(11, 9)) + (Linv(11, 10) * Linv(11, 10)) + (Linv(11, 11) * Linv(11, 11));
310 inverse(11, 10) = + (Linv(11, 9) * Linv(10, 9)) + (Linv(11, 10) * Linv(10, 10));
311 inverse(10, 11) = inverse(11, 10);
312 inverse(11, 9) = + (Linv(11, 9) * Linv(9, 9));
313 inverse(9, 11) = inverse(11, 9);
316 template <
typename TRAIT>
319 Linv(0, 0) = 1 / L(0, 0);
320 Linv(1, 1) = 1 / L(1, 1);
321 Linv(2, 2) = 1 / L(2, 2);
322 Linv(3, 3) = 1 / L(3, 3);
323 Linv(4, 4) = 1 / L(4, 4);
324 Linv(5, 5) = 1 / L(5, 5);
325 Linv(6, 6) = 1 / L(6, 6);
326 Linv(7, 7) = 1 / L(7, 7);
327 Linv(8, 8) = 1 / L(8, 8);
328 Linv(9, 9) = 1 / L(9, 9);
329 Linv(10, 10) = 1 / L(10, 10);
330 Linv(11, 11) = 1 / L(11, 11);
331 Linv(1, 0) = - Linv(0, 0) * ((Linv(1, 1) * L(1, 0)) + 0);
332 Linv(2, 1) = - Linv(1, 1) * ((Linv(2, 2) * L(2, 1)) + 0);
333 Linv(2, 0) = - Linv(0, 0) * ((Linv(2, 1) * L(1, 0)) + (Linv(2, 2) * L(2, 0)) + 0);
334 Linv(4, 3) = - Linv(3, 3) * ((Linv(4, 4) * L(4, 3)) + 0);
335 Linv(5, 4) = - Linv(4, 4) * ((Linv(5, 5) * L(5, 4)) + 0);
336 Linv(5, 3) = - Linv(3, 3) * ((Linv(5, 4) * L(4, 3)) + (Linv(5, 5) * L(5, 3)) + 0);
337 Linv(7, 6) = - Linv(6, 6) * ((Linv(7, 7) * L(7, 6)) + 0);
338 Linv(8, 7) = - Linv(7, 7) * ((Linv(8, 8) * L(8, 7)) + 0);
339 Linv(8, 6) = - Linv(6, 6) * ((Linv(8, 7) * L(7, 6)) + (Linv(8, 8) * L(8, 6)) + 0);
340 Linv(10, 9) = - Linv(9, 9) * ((Linv(10, 10) * L(10, 9)) + 0);
341 Linv(11, 10) = - Linv(10, 10) * ((Linv(11, 11) * L(11, 10)) + 0);
342 Linv(11, 9) = - Linv(9, 9) * ((Linv(11, 10) * L(10, 9)) + (Linv(11, 11) * L(11, 9)) + 0);
#define DATA
Definition: jsim.impl.h:17
const IMatrix & getTensor_LF_hipassembly() const
Definition: inertia_properties.h:114
Definition: declarations.h:37
iit::TestHyQ::tpl::JointState< Scalar > JointState
Definition: jsim.h:32
Definition: declarations.h:28
Definition: declarations.h:33
JSIM(IProperties &, FTransforms &)
Definition: jsim.impl.h:5
const IMatrix & getTensor_LH_hipassembly() const
Definition: inertia_properties.h:138
Definition: declarations.h:32
void computeLInverse()
Definition: jsim.impl.h:317
Definition: declarations.h:34
const IMatrix & getTensor_RH_hipassembly() const
Definition: inertia_properties.h:150
Definition: declarations.h:31
#define F(i, j)
Definition: jsim.impl.h:19
#define Fcol(j)
Definition: jsim.impl.h:18
Definition: declarations.h:27
void computeL()
Definition: jsim.impl.h:206
Definition: inertia_properties.h:24
const IMatrix & getTensor_RF_upperleg() const
Definition: inertia_properties.h:130
Definition: declarations.h:29
const IMatrix & getTensor_LH_upperleg() const
Definition: inertia_properties.h:142
const IMatrix & getTensor_trunk() const
Definition: inertia_properties.h:110
const IMatrix & getTensor_RH_upperleg() const
Definition: inertia_properties.h:154
Definition: declarations.h:30
const IMatrix & getTensor_RF_hipassembly() const
Definition: inertia_properties.h:126
Definition: declarations.h:26
Definition: declarations.h:36
Definition: declarations.h:35
const JSIM & update(const JointState &)
Definition: jsim.impl.h:22
const IMatrix & getTensor_LF_upperleg() const
Definition: inertia_properties.h:118
void computeInverse()
Definition: jsim.impl.h:275
iit::TestHyQ::tpl::ForceTransforms< TRAIT > FTransforms
Definition: jsim.h:41