pinocchio  2.4.4
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
inertia.hpp
1 //
2 // Copyright (c) 2015-2019 CNRS INRIA
3 // Copyright (c) 2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 
6 #ifndef __pinocchio_inertia_hpp__
7 #define __pinocchio_inertia_hpp__
8 
9 #include <iostream>
10 
11 #include "pinocchio/math/fwd.hpp"
12 #include "pinocchio/spatial/symmetric3.hpp"
13 #include "pinocchio/spatial/force.hpp"
14 #include "pinocchio/spatial/motion.hpp"
15 #include "pinocchio/spatial/skew.hpp"
16 
17 namespace pinocchio
18 {
19 
20  template< class Derived>
22  {
23  protected:
24 
25  typedef Derived Derived_t;
26  SPATIAL_TYPEDEF_TEMPLATE(Derived_t);
27 
28  public:
29  Derived_t & derived() { return *static_cast<Derived_t*>(this); }
30  const Derived_t & derived() const { return *static_cast<const Derived_t*>(this); }
31 
32  Scalar mass() const { return static_cast<const Derived_t*>(this)->mass(); }
33  Scalar & mass() { return static_cast<const Derived_t*>(this)->mass(); }
34  const Vector3 & lever() const { return static_cast<const Derived_t*>(this)->lever(); }
35  Vector3 & lever() { return static_cast<const Derived_t*>(this)->lever(); }
36  const Symmetric3 & inertia() const { return static_cast<const Derived_t*>(this)->inertia(); }
37  Symmetric3 & inertia() { return static_cast<const Derived_t*>(this)->inertia(); }
38 
39  Matrix6 matrix() const { return derived().matrix_impl(); }
40  operator Matrix6 () const { return matrix(); }
41 
42  Derived_t& operator= (const Derived_t& clone){return derived().__equl__(clone);}
43  bool operator==(const Derived_t & other) const {return derived().isEqual(other);}
44  bool operator!=(const Derived_t & other) const { return !(*this == other); }
45 
46  Derived_t& operator+= (const Derived_t & Yb) { return derived().__pequ__(Yb); }
47  Derived_t operator+(const Derived_t & Yb) const { return derived().__plus__(Yb); }
48 
49  template<typename MotionDerived>
51  operator*(const MotionDense<MotionDerived> & v) const
52  { return derived().__mult__(v); }
53 
54  Scalar vtiv(const Motion & v) const { return derived().vtiv_impl(v); }
55  Matrix6 variation(const Motion & v) const { return derived().variation_impl(v); }
56 
64  template<typename M6>
65  static void vxi(const Motion & v, const Derived & I, const Eigen::MatrixBase<M6> & Iout)
66  {
67  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(M6, Matrix6);
68  Derived::vxi_impl(v,I,Iout);
69  }
70 
71  Matrix6 vxi(const Motion & v) const
72  {
73  Matrix6 Iout;
74  vxi(v,derived(),Iout);
75  return Iout;
76  }
77 
85  template<typename M6>
86  static void ivx(const Motion & v, const Derived & I, const Eigen::MatrixBase<M6> & Iout)
87  {
88  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(M6, Matrix6);
89  Derived::ivx_impl(v,I,Iout);
90  }
91 
92  Matrix6 ivx(const Motion & v) const
93  {
94  Matrix6 Iout;
95  ivx(v,derived(),Iout);
96  return Iout;
97  }
98 
99  void setZero() { derived().setZero(); }
100  void setIdentity() { derived().setIdentity(); }
101  void setRandom() { derived().setRandom(); }
102 
103  bool isApprox(const Derived & other, const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
104  { return derived().isApprox_impl(other, prec); }
105 
106  bool isZero(const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
107  { return derived().isZero_impl(prec); }
108 
110  Derived_t se3Action(const SE3 & M) const { return derived().se3Action_impl(M); }
111 
113  Derived_t se3ActionInverse(const SE3 & M) const { return derived().se3ActionInverse_impl(M); }
114 
115  void disp(std::ostream & os) const { static_cast<const Derived_t*>(this)->disp_impl(os); }
116  friend std::ostream & operator << (std::ostream & os,const InertiaBase<Derived_t> & X)
117  {
118  X.disp(os);
119  return os;
120  }
121 
122  }; // class InertiaBase
123 
124 
125  template<typename T, int U>
126  struct traits< InertiaTpl<T, U> >
127  {
128  typedef T Scalar;
129  typedef Eigen::Matrix<T,3,1,U> Vector3;
130  typedef Eigen::Matrix<T,4,1,U> Vector4;
131  typedef Eigen::Matrix<T,6,1,U> Vector6;
132  typedef Eigen::Matrix<T,3,3,U> Matrix3;
133  typedef Eigen::Matrix<T,4,4,U> Matrix4;
134  typedef Eigen::Matrix<T,6,6,U> Matrix6;
135  typedef Matrix6 ActionMatrix_t;
136  typedef Vector3 Angular_t;
137  typedef Vector3 Linear_t;
138  typedef const Vector3 ConstAngular_t;
139  typedef const Vector3 ConstLinear_t;
140  typedef Eigen::Quaternion<T,U> Quaternion_t;
141  typedef SE3Tpl<T,U> SE3;
142  typedef ForceTpl<T,U> Force;
143  typedef MotionTpl<T,U> Motion;
145  enum {
146  LINEAR = 0,
147  ANGULAR = 3
148  };
149  }; // traits InertiaTpl
150 
151  template<typename _Scalar, int _Options>
152  class InertiaTpl : public InertiaBase< InertiaTpl< _Scalar, _Options > >
153  {
154  public:
155  friend class InertiaBase< InertiaTpl< _Scalar, _Options > >;
156  SPATIAL_TYPEDEF_TEMPLATE(InertiaTpl);
157  enum { Options = _Options };
158  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
159 
160  typedef typename Symmetric3::AlphaSkewSquare AlphaSkewSquare;
161 
162  typedef typename Eigen::Matrix<_Scalar, 10, 1, _Options> Vector10;
163 
164  public:
165  // Constructors
166  InertiaTpl()
167  {}
168 
169  InertiaTpl(const Scalar mass, const Vector3 & com, const Matrix3 & rotational_inertia)
170  : m_mass(mass), m_com(com), m_inertia(rotational_inertia)
171  {}
172 
173  InertiaTpl(const Matrix6 & I6)
174  {
175  assert((I6 - I6.transpose()).isMuchSmallerThan(I6));
176  mass() = I6(LINEAR, LINEAR);
177  const Matrix3 & mc_cross = I6.template block <3,3>(ANGULAR,LINEAR);
178  lever() = unSkew(mc_cross);
179  lever() /= mass();
180 
181  Matrix3 I3 (mc_cross * mc_cross);
182  I3 /= mass();
183  I3 += I6.template block<3,3>(ANGULAR,ANGULAR);
184  inertia() = Symmetric3(I3);
185  }
186 
187  InertiaTpl(Scalar mass, const Vector3 & com, const Symmetric3 & rotational_inertia)
188  : m_mass(mass), m_com(com), m_inertia(rotational_inertia)
189  {}
190 
191  InertiaTpl(const InertiaTpl & clone) // Copy constructor
192  : m_mass(clone.mass()), m_com(clone.lever()), m_inertia(clone.inertia())
193  {}
194 
195  InertiaTpl& operator=(const InertiaTpl & clone) // Copy assignment operator
196  {
197  m_mass = clone.mass();
198  m_com = clone.lever();
199  m_inertia = clone.inertia();
200  return *this;
201  }
202 
203  template<int O2>
204  InertiaTpl(const InertiaTpl<Scalar,O2> & clone)
205  : m_mass(clone.mass())
206  , m_com(clone.lever())
207  , m_inertia(clone.inertia().matrix())
208  {}
209 
210  // Initializers
211  static InertiaTpl Zero()
212  {
213  return InertiaTpl(Scalar(0),
214  Vector3::Zero(),
215  Symmetric3::Zero());
216  }
217 
218  void setZero() { mass() = Scalar(0); lever().setZero(); inertia().setZero(); }
219 
220  static InertiaTpl Identity()
221  {
222  return InertiaTpl(Scalar(1),
223  Vector3::Zero(),
224  Symmetric3::Identity());
225  }
226 
227  void setIdentity ()
228  {
229  mass() = Scalar(1); lever().setZero(); inertia().setIdentity();
230  }
231 
232  static InertiaTpl Random()
233  {
234  // We have to shoot "I" definite positive and not only symmetric.
235  return InertiaTpl(Eigen::internal::random<Scalar>()+1,
236  Vector3::Random(),
237  Symmetric3::RandomPositive());
238  }
239 
240  static InertiaTpl FromSphere(const Scalar m, const Scalar radius)
241  {
242  return FromEllipsoid(m,radius,radius,radius);
243  }
244 
245  static InertiaTpl FromEllipsoid(const Scalar m, const Scalar x,
246  const Scalar y, const Scalar z)
247  {
248  Scalar a = m * (y*y + z*z) / Scalar(5);
249  Scalar b = m * (x*x + z*z) / Scalar(5);
250  Scalar c = m * (y*y + x*x) / Scalar(5);
251  return InertiaTpl(m, Vector3::Zero(), Symmetric3(a, Scalar(0), b,
252  Scalar(0), Scalar(0), c));
253  }
254 
255  static InertiaTpl FromCylinder(const Scalar m, const Scalar r, const Scalar l)
256  {
257  Scalar a = m * (r*r / Scalar(4) + l*l / Scalar(12));
258  Scalar c = m * (r*r / Scalar(2));
259  return InertiaTpl(m, Vector3::Zero(), Symmetric3(a, Scalar(0), a,
260  Scalar(0), Scalar(0), c));
261  }
262 
263  static InertiaTpl FromBox(const Scalar m, const Scalar x,
264  const Scalar y, const Scalar z)
265  {
266  Scalar a = m * (y*y + z*z) / Scalar(12);
267  Scalar b = m * (x*x + z*z) / Scalar(12);
268  Scalar c = m * (y*y + x*x) / Scalar(12);
269  return InertiaTpl(m, Vector3::Zero(), Symmetric3(a, Scalar(0), b,
270  Scalar(0), Scalar(0), c));
271  }
272 
273  void setRandom()
274  {
275  mass() = static_cast<Scalar>(std::rand())/static_cast<Scalar>(RAND_MAX);
276  lever().setRandom(); inertia().setRandom();
277  }
278 
279  Matrix6 matrix_impl() const
280  {
281  Matrix6 M;
282 
283  M.template block<3,3>(LINEAR, LINEAR ).setZero();
284  M.template block<3,3>(LINEAR, LINEAR ).diagonal().fill (mass());
285  M.template block<3,3>(ANGULAR,LINEAR ) = alphaSkew(mass(),lever());
286  M.template block<3,3>(LINEAR, ANGULAR) = -M.template block<3,3>(ANGULAR, LINEAR);
287  M.template block<3,3>(ANGULAR,ANGULAR) = (inertia() - AlphaSkewSquare(mass(),lever())).matrix();
288 
289  return M;
290  }
291 
298  Vector10 toDynamicParameters() const
299  {
300  Vector10 v;
301 
302  v[0] = mass();
303  v.template segment<3>(1) = mass() * lever();
304  v.template segment<6>(4) = (inertia() - AlphaSkewSquare(mass(),lever())).data();
305 
306  return v;
307  }
308 
317  template<typename Vector10Like>
318  static InertiaTpl FromDynamicParameters(const Eigen::MatrixBase<Vector10Like> & params)
319  {
320  PINOCCHIO_ASSERT_MATRIX_SPECIFIC_SIZE(Vector10Like, params, 10, 1);
321 
322  const Scalar & mass = params[0];
323  Vector3 lever = params.template segment<3>(1);
324  lever /= mass;
325 
326  return InertiaTpl(mass, lever, Symmetric3(params.template segment<6>(4)) + AlphaSkewSquare(mass,lever));
327  }
328 
329  // Arithmetic operators
330  InertiaTpl & __equl__(const InertiaTpl & clone)
331  {
332  mass() = clone.mass(); lever() = clone.lever(); inertia() = clone.inertia();
333  return *this;
334  }
335 
336  // Required by std::vector boost::python bindings.
337  bool isEqual( const InertiaTpl& Y2 ) const
338  {
339  return (mass()==Y2.mass()) && (lever()==Y2.lever()) && (inertia()==Y2.inertia());
340  }
341 
342  bool isApprox_impl(const InertiaTpl & other,
343  const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
344  {
345  using math::fabs;
346  return fabs(mass() - other.mass()) <= prec
347  && lever().isApprox(other.lever(),prec)
348  && inertia().isApprox(other.inertia(),prec);
349  }
350 
351  bool isZero_impl(const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
352  {
353  using math::fabs;
354  return fabs(mass()) <= prec
355  && lever().isZero(prec)
356  && inertia().isZero(prec);
357  }
358 
359  InertiaTpl __plus__(const InertiaTpl & Yb) const
360  {
361  /* Y_{a+b} = ( m_a+m_b,
362  * (m_a*c_a + m_b*c_b ) / (m_a + m_b),
363  * I_a + I_b - (m_a*m_b)/(m_a+m_b) * AB_x * AB_x )
364  */
365 
366  const Scalar & mab = mass()+Yb.mass();
367  const Scalar mab_inv = Scalar(1)/mab;
368  const Vector3 & AB = (lever()-Yb.lever()).eval();
369  return InertiaTpl(mab,
370  (mass()*lever()+Yb.mass()*Yb.lever())*mab_inv,
371  inertia()+Yb.inertia() - (mass()*Yb.mass()*mab_inv)* typename Symmetric3::SkewSquare(AB));
372  }
373 
374  InertiaTpl& __pequ__(const InertiaTpl & Yb)
375  {
376  const InertiaTpl& Ya = *this;
377  const Scalar & mab = Ya.mass()+Yb.mass();
378  const Scalar mab_inv = Scalar(1)/mab;
379  const Vector3 & AB = (Ya.lever()-Yb.lever()).eval();
380  lever() *= (mass()*mab_inv); lever() += (Yb.mass()*mab_inv)*Yb.lever(); //c *= mab_inv;
381  inertia() += Yb.inertia(); inertia() -= (Ya.mass()*Yb.mass()*mab_inv)* typename Symmetric3::SkewSquare(AB);
382  mass() = mab;
383  return *this;
384  }
385 
386  template<typename MotionDerived>
388  __mult__(const MotionDense<MotionDerived> & v) const
389  {
391  ReturnType f;
392  __mult__(v,f);
393  return f;
394  }
395 
396  template<typename MotionDerived, typename ForceDerived>
397  void __mult__(const MotionDense<MotionDerived> & v, ForceDense<ForceDerived> & f) const
398  {
399  f.linear().noalias() = mass()*(v.linear() - lever().cross(v.angular()));
400  Symmetric3::rhsMult(inertia(),v.angular(),f.angular());
401  f.angular() += lever().cross(f.linear());
402 // f.angular().noalias() = c.cross(f.linear()) + I*v.angular();
403  }
404 
405  Scalar vtiv_impl(const Motion & v) const
406  {
407  const Vector3 cxw (lever().cross(v.angular()));
408  Scalar res = mass() * (v.linear().squaredNorm() - Scalar(2)*v.linear().dot(cxw));
409  const Vector3 mcxcxw (-mass()*lever().cross(cxw));
410  res += v.angular().dot(mcxcxw);
411  res += inertia().vtiv(v.angular());
412 
413  return res;
414  }
415 
416  Matrix6 variation(const Motion & v) const
417  {
418  Matrix6 res;
419  const Motion mv(v*mass());
420 
421  res.template block<3,3>(LINEAR,ANGULAR) = -skew(mv.linear()) - skewSquare(mv.angular(),lever()) + skewSquare(lever(),mv.angular());
422  res.template block<3,3>(ANGULAR,LINEAR) = res.template block<3,3>(LINEAR,ANGULAR).transpose();
423 
424 // res.template block<3,3>(LINEAR,LINEAR) = mv.linear()*c.transpose(); // use as temporary variable
425 // res.template block<3,3>(ANGULAR,ANGULAR) = res.template block<3,3>(LINEAR,LINEAR) - res.template block<3,3>(LINEAR,LINEAR).transpose();
426  res.template block<3,3>(ANGULAR,ANGULAR) = -skewSquare(mv.linear(),lever()) - skewSquare(lever(),mv.linear());
427 
428  res.template block<3,3>(LINEAR,LINEAR) = (inertia() - AlphaSkewSquare(mass(),lever())).matrix();
429 
430  res.template block<3,3>(ANGULAR,ANGULAR) -= res.template block<3,3>(LINEAR,LINEAR) * skew(v.angular());
431  res.template block<3,3>(ANGULAR,ANGULAR) += cross(v.angular(),res.template block<3,3>(LINEAR,LINEAR));
432 
433  res.template block<3,3>(LINEAR,LINEAR).setZero();
434  return res;
435  }
436 
437  template<typename M6>
438  static void vxi_impl(const Motion & v,
439  const InertiaTpl & I,
440  const Eigen::MatrixBase<M6> & Iout)
441  {
442  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(M6,6,6);
443  M6 & Iout_ = PINOCCHIO_EIGEN_CONST_CAST(M6,Iout);
444 
445  // Block 1,1
446  alphaSkew(I.mass(),v.angular(),Iout_.template block<3,3>(LINEAR,LINEAR));
447 // Iout_.template block<3,3>(LINEAR,LINEAR) = alphaSkew(I.mass(),v.angular());
448  const Vector3 mc(I.mass()*I.lever());
449 
450  // Block 1,2
451  skewSquare(-v.angular(),mc,Iout_.template block<3,3>(LINEAR,ANGULAR));
452 
453 
455  alphaSkew(I.mass(),v.linear(),Iout_.template block<3,3>(ANGULAR,LINEAR));
456  Iout_.template block<3,3>(ANGULAR,LINEAR) -= Iout_.template block<3,3>(LINEAR,ANGULAR);
457 
459  skewSquare(-v.linear(),mc,Iout_.template block<3,3>(ANGULAR,ANGULAR));
460 
461  // TODO: I do not why, but depending on the CPU, these three lines can give
462  // wrong output.
463  // typename Symmetric3::AlphaSkewSquare mcxcx(I.mass(),I.lever());
464  // const Symmetric3 I_mcxcx(I.inertia() - mcxcx);
465  // Iout_.template block<3,3>(ANGULAR,ANGULAR) += I_mcxcx.vxs(v.angular());
466  Symmetric3 mcxcx(typename Symmetric3::AlphaSkewSquare(I.mass(),I.lever()));
467  Iout_.template block<3,3>(ANGULAR,ANGULAR) += I.inertia().vxs(v.angular());
468  Iout_.template block<3,3>(ANGULAR,ANGULAR) -= mcxcx.vxs(v.angular());
469 
470  }
471 
472  template<typename M6>
473  static void ivx_impl(const Motion & v,
474  const InertiaTpl & I,
475  const Eigen::MatrixBase<M6> & Iout)
476  {
477  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(M6,6,6);
478  M6 & Iout_ = PINOCCHIO_EIGEN_CONST_CAST(M6,Iout);
479 
480  // Block 1,1
481  alphaSkew(I.mass(),v.angular(),Iout_.template block<3,3>(LINEAR,LINEAR));
482 
483  // Block 2,1
484  const Vector3 mc(I.mass()*I.lever());
485  skewSquare(mc,v.angular(),Iout_.template block<3,3>(ANGULAR,LINEAR));
486 
487  // Block 1,2
488  alphaSkew(I.mass(),v.linear(),Iout_.template block<3,3>(LINEAR,ANGULAR));
489 
490  // Block 2,2
491  cross(-I.lever(),Iout_.template block<3,3>(ANGULAR,LINEAR),Iout_.template block<3,3>(ANGULAR,ANGULAR));
492  Iout_.template block<3,3>(ANGULAR,ANGULAR) += I.inertia().svx(v.angular());
493  for(int k = 0; k < 3; ++k)
494  Iout_.template block<3,3>(ANGULAR,ANGULAR).col(k) += I.lever().cross(Iout_.template block<3,3>(LINEAR,ANGULAR).col(k));
495 
496  // Block 1,2
497  Iout_.template block<3,3>(LINEAR,ANGULAR) -= Iout_.template block<3,3>(ANGULAR,LINEAR);
498 
499  }
500 
501  // Getters
502  Scalar mass() const { return m_mass; }
503  const Vector3 & lever() const { return m_com; }
504  const Symmetric3 & inertia() const { return m_inertia; }
505 
506  Scalar & mass() { return m_mass; }
507  Vector3 & lever() { return m_com; }
508  Symmetric3 & inertia() { return m_inertia; }
509 
511  InertiaTpl se3Action_impl(const SE3 & M) const
512  {
513  /* The multiplication RIR' has a particular form that could be used, however it
514  * does not seems to be more efficient, see http://stackoverflow.m_comom/questions/
515  * 13215467/eigen-best-way-to-evaluate-asa-transpose-and-store-the-result-in-a-symmetric .*/
516  return InertiaTpl(mass(),
517  M.translation()+M.rotation()*lever(),
518  inertia().rotate(M.rotation()));
519  }
520 
522  InertiaTpl se3ActionInverse_impl(const SE3 & M) const
523  {
524  return InertiaTpl(mass(),
525  M.rotation().transpose()*(lever()-M.translation()),
526  inertia().rotate(M.rotation().transpose()) );
527  }
528 
529  Force vxiv( const Motion& v ) const
530  {
531  const Vector3 & mcxw = mass()*lever().cross(v.angular());
532  const Vector3 & mv_mcxw = mass()*v.linear()-mcxw;
533  return Force( v.angular().cross(mv_mcxw),
534  v.angular().cross(lever().cross(mv_mcxw)+inertia()*v.angular())-v.linear().cross(mcxw) );
535  }
536 
537  void disp_impl(std::ostream & os) const
538  {
539  os
540  << " m = " << mass() << "\n"
541  << " c = " << lever().transpose() << "\n"
542  << " I = \n" << inertia().matrix() << "";
543  }
544 
546  template<typename NewScalar>
548  {
549  return InertiaTpl<NewScalar,Options>(static_cast<NewScalar>(mass()),
550  lever().template cast<NewScalar>(),
551  inertia().template cast<NewScalar>());
552  }
553 
554  protected:
555  Scalar m_mass;
556  Vector3 m_com;
557  Symmetric3 m_inertia;
558 
559  }; // class InertiaTpl
560 
561 } // namespace pinocchio
562 
563 #endif // ifndef __pinocchio_inertia_hpp__
void unSkew(const Eigen::MatrixBase< Matrix3 > &M, const Eigen::MatrixBase< Vector3 > &v)
Inverse of skew operator. From a given skew-symmetric matrix M of dimension 3x3, it extracts the supp...
Definition: skew.hpp:82
static void vxi(const Motion &v, const Derived &I, const Eigen::MatrixBase< M6 > &Iout)
Time variation operator. It computes the time derivative of an inertia I corresponding to the formula...
Definition: inertia.hpp:65
static void ivx(const Motion &v, const Derived &I, const Eigen::MatrixBase< M6 > &Iout)
Time variation operator. It computes the time derivative of an inertia I corresponding to the formula...
Definition: inertia.hpp:86
InertiaTpl se3ActionInverse_impl(const SE3 &M) const
bI = aXb.actInv(aI)
Definition: inertia.hpp:522
ConstAngularType angular() const
Return the angular part of the force vector.
Definition: force-base.hpp:35
Derived_t se3ActionInverse(const SE3 &M) const
bI = aXb.actInv(aI)
Definition: inertia.hpp:113
void cross(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3xIn > &Min, const Eigen::MatrixBase< Matrix3xOut > &Mout)
Applies the cross product onto the columns of M.
Definition: skew.hpp:211
InertiaTpl< NewScalar, Options > cast() const
Definition: inertia.hpp:547
Derived_t se3Action(const SE3 &M) const
aI = aXb.act(bI)
Definition: inertia.hpp:110
Vector10 toDynamicParameters() const
Definition: inertia.hpp:298
static void vxs(const Eigen::MatrixBase< Vector3 > &v, const Symmetric3Tpl &S3, const Eigen::MatrixBase< Matrix3 > &M)
Performs the operation . This operation is equivalent to applying the cross product of v on each colu...
Definition: symmetric3.hpp:224
void skewSquare(const Eigen::MatrixBase< V1 > &u, const Eigen::MatrixBase< V2 > &v, const Eigen::MatrixBase< Matrix3 > &C)
Computes the square cross product linear operator C(u,v) such that for any vector w...
Definition: skew.hpp:166
Main pinocchio namespace.
Definition: treeview.dox:24
static void svx(const Eigen::MatrixBase< Vector3 > &v, const Symmetric3Tpl &S3, const Eigen::MatrixBase< Matrix3 > &M)
Performs the operation .
Definition: symmetric3.hpp:285
InertiaTpl se3Action_impl(const SE3 &M) const
aI = aXb.act(bI)
Definition: inertia.hpp:511
void alphaSkew(const Scalar alpha, const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3 > &M)
Computes the skew representation of a given 3d vector multiplied by a given scalar. i.e. the antisymmetric matrix representation of the cross product operator ( )
Definition: skew.hpp:124
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:35
void skew(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3 > &M)
Computes the skew representation of a given 3d vector, i.e. the antisymmetric matrix representation o...
Definition: skew.hpp:21
ConstLinearType linear() const
Return the linear part of the force vector.
Definition: force-base.hpp:42
static InertiaTpl FromDynamicParameters(const Eigen::MatrixBase< Vector10Like > &params)
Definition: inertia.hpp:318