pinocchio  UNKNOWN
joint-spherical-ZYX.hpp
1 //
2 // Copyright (c) 2015-2018 CNRS
3 // Copyright (c) 2015-2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 // This file is part of Pinocchio
6 // Pinocchio is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // Pinocchio is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // Pinocchio If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef __se3_joint_spherical_ZYX_hpp__
20 #define __se3_joint_spherical_ZYX_hpp__
21 #include <iostream>
22 #include "pinocchio/macros.hpp"
23 #include "pinocchio/multibody/joint/joint-base.hpp"
24 #include "pinocchio/multibody/constraint.hpp"
25 #include "pinocchio/math/sincos.hpp"
26 #include "pinocchio/spatial/inertia.hpp"
27 #include "pinocchio/spatial/skew.hpp"
28 
29 namespace se3
30 {
31 
32  template<typename Scalar, int Options> struct BiasSphericalZYXTpl;
33 
34  template<typename _Scalar, int _Options>
35  struct traits< BiasSphericalZYXTpl<_Scalar,_Options> >
36  {
37  typedef _Scalar Scalar;
38  enum { Options = _Options };
39  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
40  typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
41  typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
42  typedef typename EIGEN_REF_CONSTTYPE(Vector6) ToVectorConstReturnType;
43  typedef typename EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
44  typedef Matrix6 ActionMatrixType;
45  typedef typename Vector6::template FixedSegmentReturnType<3>::Type LinearType;
46  typedef typename Vector6::template FixedSegmentReturnType<3>::Type AngularType;
47  typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
48  typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
50  enum {
51  LINEAR = 0,
52  ANGULAR = 3
53  };
54  };
55 
56  template <typename _Scalar, int _Options>
57  struct BiasSphericalZYXTpl : MotionBase< BiasSphericalZYXTpl<_Scalar,_Options> >
58  {
59  MOTION_TYPEDEF_TPL(BiasSphericalZYXTpl);
60 
61  BiasSphericalZYXTpl () : c_J(Vector3::Constant(NAN)) {}
62 
63  operator MotionPlain () const
64  { return MotionPlain(MotionPlain::Vector3::Zero(),c_J); }
65 
66  Vector3 & operator() () { return c_J; }
67  const Vector3 & operator() () const { return c_J; }
68 
69  template<typename D2>
70  bool isEqual_impl(const MotionDense<D2> & other) const
71  { return other.linear().isZero() && other.angular() == c_J; }
72 
73  template<typename D2>
74  void addTo(MotionDense<D2> & other) const
75  { other.angular() += c_J; }
76 
77  Vector3 c_J;
78  }; // struct BiasSphericalZYXTpl
79 
80  template<typename MotionDerived, typename S2, int O2>
81  inline typename MotionDerived::MotionPlain
82  operator+(const MotionDense<MotionDerived> & v, const BiasSphericalZYXTpl<S2,O2> & c)
83  { return typename MotionDerived::MotionPlain(v.linear(), v.angular() + c()); }
84 
85  template<typename S1, int O1, typename MotionDerived>
86  inline typename MotionDerived::MotionPlain
87  operator+(const BiasSphericalZYXTpl<S1,O1> & c, const MotionDense<MotionDerived> & v)
88  { return typename MotionDerived::MotionPlain(v.linear(), v.angular() + c()); }
89 
90  template<typename Scalar, int Options> struct MotionSphericalZYXTpl;
91 
92  template<typename Scalar, int Options>
93  struct traits< MotionSphericalZYXTpl<Scalar,Options> >
94  : traits< BiasSphericalZYXTpl<Scalar,Options> >
95  {};
96 
97  template<typename _Scalar, int _Options>
98  struct MotionSphericalZYXTpl : MotionBase< BiasSphericalZYXTpl<_Scalar,_Options> >
99  {
100  MOTION_TYPEDEF_TPL(MotionSphericalZYXTpl);
101 
102  MotionSphericalZYXTpl () : w(Vector3::Constant(NAN)) {}
103 
104  template<typename Vector3Like>
105  MotionSphericalZYXTpl(const Eigen::MatrixBase<Vector3Like> & w) : w (w)
106  {}
107 
108  Vector3 & operator() () { return w; }
109  const Vector3 & operator() () const { return w; }
110 
111  operator MotionPlain() const
112  { return MotionPlain(MotionPlain::Vector3::Zero(),w); }
113 
114  operator Vector3() const { return w; }
115 
116  template<typename Derived>
117  void addTo(MotionDense<Derived> & v) const
118  {
119  v.angular() += w;
120  }
121 
122  Vector3 w;
123  }; // struct MotionSphericalZYXTpl
124 
125  template <typename S1, int O1, typename S2, int O2>
127  operator+(const MotionSphericalZYXTpl<S1,O1> & m,
128  const BiasSphericalZYXTpl<S2,O2> & c)
129  { return MotionSphericalZYXTpl<S1,O1>(m.w + c.c_J); }
130 
131  template <typename S1, int O1, typename MotionDerived>
132  typename MotionDerived::MotionPlain
133  operator+(const MotionSphericalZYXTpl<S1,O1> & m1,
134  const MotionDense<MotionDerived> & m2)
135  {
136  typedef typename MotionDerived::MotionPlain ReturnType;
137  return ReturnType(m2.linear(),m2.angular()+ m1.w);
138  }
139 
140  template<typename Scalar, int Options> struct ConstraintSphericalZYXTpl;
141 
142  template <typename _Scalar, int _Options>
143  struct traits< ConstraintSphericalZYXTpl<_Scalar,_Options> >
144  {
145  typedef _Scalar Scalar;
146  enum { Options = _Options };
147  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
148  typedef Eigen::Matrix<Scalar,4,1,Options> Vector4;
149  typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
150  typedef Eigen::Matrix<Scalar,3,3,Options> Matrix3;
151  typedef Eigen::Matrix<Scalar,4,4,Options> Matrix4;
152  typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
153  typedef Matrix3 Angular_t;
154  typedef Vector3 Linear_t;
155  typedef const Matrix3 ConstAngular_t;
156  typedef const Vector3 ConstLinear_t;
157  typedef Matrix6 ActionMatrix_t;
158  typedef Eigen::Quaternion<Scalar,Options> Quaternion_t;
159  typedef SE3Tpl<Scalar,Options> SE3;
163  enum {
164  LINEAR = 0,
165  ANGULAR = 3
166  };
167  typedef Eigen::Matrix<Scalar,3,1,Options> JointMotion;
168  typedef Eigen::Matrix<Scalar,3,1,Options> JointForce;
169  typedef Eigen::Matrix<Scalar,6,3,Options> DenseBase;
170  typedef DenseBase MatrixReturnType;
171  typedef const DenseBase ConstMatrixReturnType;
172  }; // struct traits struct ConstraintRotationalSubspace
173 
174  template<typename _Scalar, int _Options>
175  struct ConstraintSphericalZYXTpl : public ConstraintBase< ConstraintSphericalZYXTpl<_Scalar,_Options> >
176  {
177  SPATIAL_TYPEDEF_TEMPLATE(ConstraintSphericalZYXTpl);
178  enum { NV = 3, Options = _Options };
179 
180  typedef typename traits<ConstraintSphericalZYXTpl>::JointMotion JointMotion;
181  typedef typename traits<ConstraintSphericalZYXTpl>::JointForce JointForce;
182  typedef typename traits<ConstraintSphericalZYXTpl>::DenseBase DenseBase;
183 
185  : S_minimal(Matrix3::Constant(NAN))
186  {}
187 
188  template<typename Matrix3Like>
189  ConstraintSphericalZYXTpl(const Eigen::MatrixBase<Matrix3Like> & subspace)
190  : S_minimal(subspace)
191  { EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix3Like,3,3); }
192 
193  template<typename S1, int O1>
194  Motion operator*(const MotionSphericalZYXTpl<S1,O1> & vj) const
195  { return Motion(Motion::Vector3::Zero(),
196  S_minimal * vj());
197 
198  }
199  template<typename Vector3Like>
200  Motion operator*(const Eigen::MatrixBase<Vector3Like> & v) const
201  {
202  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like,3);
203  return Motion(Motion::Vector3::Zero(), S_minimal * v);
204  }
205 
206 
207  Matrix3 & operator() () { return S_minimal; }
208  const Matrix3 & operator() () const { return S_minimal; }
209 
210  int nv_impl() const { return NV; }
211 
213  {
214  const ConstraintSphericalZYXTpl & ref;
215  ConstraintTranspose(const ConstraintSphericalZYXTpl & ref) : ref(ref) {}
216 
217  template<typename Derived>
218 #if EIGEN_VERSION_AT_LEAST(3,2,90)
219  const typename Eigen::Product<
220  Eigen::Transpose<const Matrix3>,
221  Eigen::Block<const typename ForceDense<Derived>::Vector6,3,1>
222  >
223 #else
224  const typename Eigen::ProductReturnType<
225  Eigen::Transpose<const Matrix3>,
226  // typename Motion::ConstAngular_t::Base /* This feature leads currently to a bug */
227  Eigen::Block<const typename ForceDense<Derived>::Vector6,3,1>
228  >::Type
229 #endif
230  operator* (const ForceDense<Derived> & phi) const
231  {
232  return ref.S_minimal.transpose() * phi.angular();
233  }
234 
235  /* [CRBA] MatrixBase operator* (Constraint::Transpose S, ForceSet::Block) */
236  template<typename D>
237 #if EIGEN_VERSION_AT_LEAST(3,2,90)
238  const typename Eigen::Product<
239  typename Eigen::Transpose<const Matrix3>,
240  typename Eigen::MatrixBase<const D>::template NRowsBlockXpr<3>::Type
241  >
242 #else
243  const typename Eigen::ProductReturnType<
244  typename Eigen::Transpose<const Matrix3>,
245  typename Eigen::MatrixBase<const D>::template NRowsBlockXpr<3>::Type
246  >::Type
247 #endif
248  operator* (const Eigen::MatrixBase<D> & F) const
249  {
250  EIGEN_STATIC_ASSERT(D::RowsAtCompileTime==6,THIS_METHOD_IS_ONLY_FOR_MATRICES_OF_A_SPECIFIC_SIZE)
251  return ref.S_minimal.transpose () * F.template middleRows<3>(ANGULAR);
252  }
253  }; // struct ConstraintTranspose
254 
255  ConstraintTranspose transpose () const { return ConstraintTranspose(*this); }
256 
257  DenseBase matrix_impl() const
258  {
259  DenseBase S;
260  S.template middleRows<3>(LINEAR).setZero();
261  S.template middleRows<3>(ANGULAR) = S_minimal;
262  return S;
263  }
264 
265  // const typename Eigen::ProductReturnType<
266  // const ConstraintDense,
267  // const Matrix3
268  // >::Type
269  template<typename S1, int O1>
270  Eigen::Matrix<Scalar,6,3,Options>
271  se3Action(const SE3Tpl<S1,O1> & m) const
272  {
273  // Eigen::Matrix <Scalar,6,3,Options> X_subspace;
274  // X_subspace.template block <3,3> (Motion::LINEAR, 0) = skew (m.translation ()) * m.rotation ();
275  // X_subspace.template block <3,3> (Motion::ANGULAR, 0) = m.rotation ();
276  //
277  // return (X_subspace * S_minimal).eval();
278 
279  Eigen::Matrix<Scalar,6,3,Options> result;
280  result.template middleRows<3>(ANGULAR).noalias() = m.rotation () * S_minimal;
281  for(int k = 0; k < 3; ++k)
282  result.template middleRows<3>(LINEAR).col(k) =
283  m.translation().cross(result.template middleRows<3>(Motion::ANGULAR).col(k));
284 
285  return result;
286  }
287 
288  template<typename MotionDerived>
289  DenseBase motionAction(const MotionDense<MotionDerived> & m) const
290  {
291  const typename MotionDerived::ConstLinearType v = m.linear();
292  const typename MotionDerived::ConstAngularType w = m.angular();
293 
294  DenseBase res;
295  cross(v,S_minimal,res.template middleRows<3>(LINEAR));
296  cross(w,S_minimal,res.template middleRows<3>(ANGULAR));
297 
298  return res;
299  }
300 
301  // data
302  Matrix3 S_minimal;
303 
304  }; // struct ConstraintSphericalZYXTpl
305 
306 // template <typename _Scalar, int _Options>
307 // struct JointSphericalZYXTpl
308 // {
309 // typedef _Scalar Scalar;
310 // enum { Options = _Options };
311 // typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
312 // typedef Eigen::Matrix<Scalar,3,3,Options> Matrix3;
313 // typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
314 // typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
315 // typedef MotionTpl<Scalar,Options> Motion;
316 // typedef ForceTpl<Scalar,Options> Force;
317 // typedef SE3Tpl<Scalar,Options> SE3;
318 //
319 // typedef BiasSphericalZYXTpl<_Scalar,_Options> BiasSpherical;
320 // typedef MotionSphericalZYXTpl<_Scalar,_Options> MotionSpherical;
321 // typedef ConstraintSphericalZYXTpl<_Scalar,_Options> ConstraintRotationalSubspace;
322 //
323 // }; // struct JointSphericalZYX
324 
325 // typedef JointSphericalZYXTpl<double,0> JointSphericalZYX;
326 
327  template<typename MotionDerived, typename S2, int O2>
328  inline typename MotionDerived::MotionPlain
329  operator^(const MotionDense<MotionDerived> & m1, const MotionSphericalZYXTpl<S2,O2> & m2)
330  {
331 // const Motion::Matrix3 m2_cross (skew (Motion::Vector3 (-m2.w)));
332 // return Motion(m2_cross * m1.linear (), m2_cross * m1.angular ());
333  typedef typename MotionDerived::MotionPlain ReturnType;
334  return ReturnType(m1.linear().cross(m2.w), m1.angular().cross(m2.w));
335  }
336 
337  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
338  template <typename S1, int O1, typename S2, int O2>
339  Eigen::Matrix<S1,6,3,O1>
340  operator*(const InertiaTpl<S1,O1> & Y,
342  {
343  typedef typename InertiaTpl<S1,O1>::Symmetric3 Symmetric3;
344  typedef ConstraintSphericalZYXTpl<S2,O2> Constraint;
345  Eigen::Matrix<S1,6,3,O1> M;
346  alphaSkew (-Y.mass(),Y.lever(),M.template middleRows<3>(Constraint::LINEAR));
347  M.template middleRows<3>(Constraint::ANGULAR) = (Y.inertia () -
348  typename Symmetric3::AlphaSkewSquare(Y.mass (), Y.lever ())).matrix();
349 
350  return (M * S.S_minimal).eval();
351  }
352 
353  /* [ABA] Y*S operator (Inertia Y,Constraint S) */
354  // inline Eigen::Matrix<double,6,3>
355  template<typename Matrix6Like, typename S2, int O2>
356 #if EIGEN_VERSION_AT_LEAST(3,2,90)
357  const typename Eigen::Product<
358  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType>::type,
360  >
361 #else
362  const typename Eigen::ProductReturnType<
363  typename Eigen::internal::remove_const<typename SizeDepType<3>::ColsReturn<Matrix6Like>::ConstType>::type,
365  >::Type
366 #endif
367  operator*(const Eigen::MatrixBase<Matrix6Like> & Y,
369  {
370  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix6Like,6,6);
371  return Y.derived().template middleCols<3>(Inertia::ANGULAR) * S.S_minimal;
372  }
373 
374  namespace internal
375  {
376  template<typename S1, int O1>
377  struct SE3GroupAction< ConstraintSphericalZYXTpl<S1,O1> >
378  {
379 // typedef const typename Eigen::ProductReturnType<
380 // Eigen::Matrix <double,6,3,0>,
381 // Eigen::Matrix <double,3,3,0>
382 // >::Type Type;
383  typedef Eigen::Matrix<S1,6,3,O1> ReturnType;
384  };
385 
386  template<typename S1, int O1, typename MotionDerived>
387  struct MotionAlgebraAction< ConstraintSphericalZYXTpl<S1,O1>, MotionDerived >
388  {
389  typedef Eigen::Matrix<S1,6,3,O1> ReturnType;
390  };
391  }
392 
393  template<typename Scalar, int Options> struct JointSphericalZYXTpl;
394 
395  template<typename _Scalar, int _Options>
396  struct traits< JointSphericalZYXTpl<_Scalar,_Options> >
397  {
398  enum {
399  NQ = 3,
400  NV = 3
401  };
402  typedef _Scalar Scalar;
403  enum { Options = _Options };
410  typedef Eigen::Matrix<Scalar,6,NV,Options> F_t;
411 
412  // [ABA]
413  typedef Eigen::Matrix<Scalar,6,NV,Options> U_t;
414  typedef Eigen::Matrix<Scalar,NV,NV,Options> D_t;
415  typedef Eigen::Matrix<Scalar,6,NV,Options> UD_t;
416 
417  typedef Eigen::Matrix<Scalar,NQ,1,Options> ConfigVector_t;
418  typedef Eigen::Matrix<Scalar,NV,1,Options> TangentVector_t;
419  };
420 
421  template<typename Scalar, int Options>
422  struct traits< JointDataSphericalZYXTpl<Scalar,Options> >
424 
425  template<typename Scalar, int Options>
426  struct traits< JointModelSphericalZYXTpl<Scalar,Options> >
428 
429  template<typename _Scalar, int _Options>
430  struct JointDataSphericalZYXTpl : public JointDataBase< JointDataSphericalZYXTpl<_Scalar,_Options> >
431  {
433  SE3_JOINT_TYPEDEF_TEMPLATE;
434 
435  Constraint_t S;
436  Transformation_t M;
437  Motion_t v;
438  Bias_t c;
439 
440  F_t F;
441 
442  // [ABA] specific data
443  U_t U;
444  D_t Dinv;
445  UD_t UDinv;
446 
447  JointDataSphericalZYXTpl () : M(1), U(), Dinv(), UDinv() {}
448 
449  }; // strcut JointDataSphericalZYXTpl
450 
451  template<typename _Scalar, int _Options>
452  struct JointModelSphericalZYXTpl : public JointModelBase< JointModelSphericalZYXTpl<_Scalar,_Options> >
453  {
455  SE3_JOINT_TYPEDEF_TEMPLATE;
456 
461 
462  JointDataDerived createData() const { return JointDataDerived(); }
463 
464  template<typename ConfigVector>
465  void calc(JointDataDerived & data,
466  const typename Eigen::MatrixBase<ConfigVector> & qs) const
467  {
468  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(ConfigVector_t,ConfigVector);
469  typename ConfigVector::template ConstFixedSegmentReturnType<NQ>::Type & q = qs.template segment<NQ>(idx_q());
470 
471  typedef typename ConfigVector::Scalar S2;
472 
473  S2 c0,s0; SINCOS(q(0), &s0, &c0);
474  S2 c1,s1; SINCOS(q(1), &s1, &c1);
475  S2 c2,s2; SINCOS(q(2), &s2, &c2);
476 
477  data.M.rotation () << c0 * c1,
478  c0 * s1 * s2 - s0 * c2,
479  c0 * s1 * c2 + s0 * s2,
480  s0 * c1,
481  s0 * s1 * s2 + c0 * c2,
482  s0 * s1 * c2 - c0 * s2,
483  -s1,
484  c1 * s2,
485  c1 * c2;
486 
487  data.S.S_minimal
488  << -s1, Scalar(0), Scalar(1),
489  c1 * s2, c2, Scalar(0),
490  c1 * c2, -s2, Scalar(0);
491  }
492 
493  template<typename ConfigVector, typename TangentVector>
494  void calc(JointDataDerived & data,
495  const typename Eigen::MatrixBase<ConfigVector> & qs,
496  const typename Eigen::MatrixBase<TangentVector> & vs) const
497  {
498  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(ConfigVector_t,ConfigVector);
499  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TangentVector_t,TangentVector);
500  typename ConfigVector::template ConstFixedSegmentReturnType<NQ>::Type & q = qs.template segment<NQ>(idx_q());
501 
502  typedef typename ConfigVector::Scalar S2;
503 
504  S2 c0,s0; SINCOS(q(0), &s0, &c0);
505  S2 c1,s1; SINCOS(q(1), &s1, &c1);
506  S2 c2,s2; SINCOS(q(2), &s2, &c2);
507 
508  data.M.rotation () << c0 * c1,
509  c0 * s1 * s2 - s0 * c2,
510  c0 * s1 * c2 + s0 * s2,
511  s0 * c1,
512  s0 * s1 * s2 + c0 * c2,
513  s0 * s1 * c2 - c0 * s2,
514  -s1,
515  c1 * s2,
516  c1 * c2;
517 
518  data.S.S_minimal
519  << -s1, Scalar(0), Scalar(1),
520  c1 * s2, c2, Scalar(0),
521  c1 * c2, -s2, Scalar(0);
522 
523  typename TangentVector::template ConstFixedSegmentReturnType<NV>::Type & q_dot = vs.template segment<NV>(idx_v());
524 
525  data.v().noalias() = data.S.S_minimal * q_dot;
526 
527  data.c()(0) = -c1 * q_dot(0) * q_dot(1);
528  data.c()(1) = -s1 * s2 * q_dot(0) * q_dot(1) + c1 * c2 * q_dot(0) * q_dot(2) - s2 * q_dot(1) * q_dot(2);
529  data.c()(2) = -s1 * c2 * q_dot(0) * q_dot(1) - c1 * s2 * q_dot(0) * q_dot(2) - c2 * q_dot(1) * q_dot(2);
530  }
531 
532  template<typename S2, int O2>
533  void calc_aba(JointDataDerived & data, Eigen::Matrix<S2,6,6,O2> & I, const bool update_I) const
534  {
535  typedef Eigen::Matrix<S2,3,3,O2> Matrix3;
536 
537  data.U.noalias() = I.template middleCols<3>(Motion::ANGULAR) * data.S.S_minimal;
538  Matrix3 tmp(data.S.S_minimal.transpose() * data.U.template middleRows<3>(Motion::ANGULAR));
539  data.Dinv = tmp.inverse();
540  data.UDinv.noalias() = data.U * data.Dinv;
541 
542  if (update_I)
543  I -= data.UDinv * data.U.transpose();
544  }
545 
546  Scalar finiteDifferenceIncrement() const
547  {
548  using std::sqrt;
549  return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
550  }
551 
552  static std::string classname() { return std::string("JointModelSphericalZYX"); }
553  std::string shortname() const { return classname(); }
554 
555  }; // struct JointModelSphericalZYXTpl
556 
557 } // namespace se3
558 
559 #endif // ifndef __se3_joint_spherical_ZYX_hpp__
JointDataVariant createData(const JointModelVariant &jmodel)
Visit a JointModelVariant through CreateData visitor to create a JointDataVariant.
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:116
ConstAngularType angular() const
Return the angular part of the force vector.
Definition: force-base.hpp:53
void calc_aba(const JointModelVariant &jmodel, JointDataVariant &jdata, Inertia::Matrix6 &I, const bool update_I)
Visit a JointDataVariant and the corresponding JointModelVariant through JointCalcAbaVisitor to...
std::string shortname(const JointModelVariant &jmodel)
Visit a JointModelVariant through JointShortnameVisitor to get the shortname of the derived joint mod...
int idx_q(const JointModelVariant &jmodel)
Visit a JointModelVariant through JointIdxQVisitor to get the index in the full model configuration s...
Eigen::VectorXd finiteDifferenceIncrement(const Model &model)
Computes the finite difference increments for each degree of freedom according to the current joint c...
int idx_v(const JointModelVariant &jmodel)
Visit a JointModelVariant through JointIdxVVisitor to get the index in the full model tangent space c...
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:203