joint-mimic.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019-2021 INRIA
3 //
4 
5 #ifndef __pinocchio_multibody_joint_mimic_hpp__
6 #define __pinocchio_multibody_joint_mimic_hpp__
7 
8 #include "pinocchio/macros.hpp"
9 #include "pinocchio/multibody/joint/joint-base.hpp"
10 
11 namespace pinocchio
12 {
13 
14  template<class Constraint> struct ScaledConstraint;
15 
16  template<class Constraint>
17  struct traits< ScaledConstraint<Constraint> >
18  {
21  enum {
24  };
30  }; // traits ScaledConstraint
31 
32  template<class Constraint>
33  struct SE3GroupAction< ScaledConstraint<Constraint> >
35 
36  template<class Constraint, typename MotionDerived>
37  struct MotionAlgebraAction< ScaledConstraint<Constraint>, MotionDerived >
39 
40  template<class Constraint, typename ForceDerived>
41  struct ConstraintForceOp< ScaledConstraint<Constraint>, ForceDerived>
42  {
43  typedef typename Constraint::Scalar Scalar;
45 
47  typedef Eigen::Matrix<Scalar,IdealReturnType::RowsAtCompileTime,IdealReturnType::ColsAtCompileTime,Constraint::Options> ReturnType;
48  };
49 
50  template<class Constraint, typename ForceSet>
52  {
53  typedef typename Constraint::Scalar Scalar;
56  typedef Eigen::Matrix<Scalar,Constraint::NV,ForceSet::ColsAtCompileTime,Constraint::Options | Eigen::RowMajor> ReturnType;
57  };
58 
59  template<class Constraint>
60  struct ScaledConstraint
61  : ConstraintBase< ScaledConstraint<Constraint> >
62  {
63  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
64 
66  enum { NV = Constraint::NV };
68  using Base::nv;
69 
71 
73 
74  explicit ScaledConstraint(const Scalar & scaling_factor)
75  : m_scaling_factor(scaling_factor)
76  {}
77 
78  ScaledConstraint(const Constraint & constraint,
79  const Scalar & scaling_factor)
80  : m_constraint(constraint)
81  , m_scaling_factor(scaling_factor)
82  {}
83 
85  : m_constraint(other.m_constraint)
86  , m_scaling_factor(other.m_scaling_factor)
87  {}
88 
90  {
91  m_constraint = other.m_constraint;
92  m_scaling_factor = other.m_scaling_factor;
93  return *this;
94  }
95 
96  template<typename VectorLike>
97  JointMotion __mult__(const Eigen::MatrixBase<VectorLike> & v) const
98  {
99  assert(v.size() == nv());
100  JointMotion jm = m_constraint * v;
101  return jm * m_scaling_factor;
102  }
103 
104  template<typename S1, int O1>
105  SE3ActionReturnType
106  se3Action(const SE3Tpl<S1,O1> & m) const
107  {
108  SE3ActionReturnType res = m_constraint.se3Action(m);
109  return m_scaling_factor * res;
110  }
111 
112  template<typename S1, int O1>
113  SE3ActionReturnType
115  {
116  SE3ActionReturnType res = m_constraint.se3ActionInverse(m);
117  return m_scaling_factor * res;
118  }
119 
120  int nv_impl() const { return m_constraint.nv(); }
121 
123  {
125  TransposeConst(const ScaledConstraint & ref) : ref(ref) {}
126 
127  template<typename Derived>
130  {
131  // TODO: I don't know why, but we should a dense a return type, otherwise it failes at the evaluation level;
133  return ReturnType(ref.m_scaling_factor * (ref.m_constraint.transpose() * f));
134  }
135 
137  template<typename Derived>
139  operator*(const Eigen::MatrixBase<Derived> & F) const
140  {
142  return ReturnType(ref.m_scaling_factor * (ref.m_constraint.transpose() * F));
143  }
144 
145  }; // struct TransposeConst
146 
147  TransposeConst transpose() const { return TransposeConst(*this); }
148 
149  DenseBase matrix_impl() const
150  {
151  DenseBase S = m_scaling_factor * m_constraint.matrix();
152  return S;
153  }
154 
155  template<typename MotionDerived>
158  {
160  ReturnType res = m_scaling_factor * m_constraint.motionAction(m);
161  return res;
162  }
163 
164  inline const Scalar & scaling() const { return m_scaling_factor; }
165  inline Scalar & scaling() { return m_scaling_factor; }
166 
167  inline const Constraint & constraint() const { return m_constraint; }
168  inline Constraint & constraint() { return m_constraint; }
169 
170  bool isEqual(const ScaledConstraint & other) const
171  {
172  return m_constraint == other.m_constraint
173  && m_scaling_factor == other.m_scaling_factor;
174  }
175 
176  protected:
177 
178  Constraint m_constraint;
180  }; // struct ScaledConstraint
181 
182  template<typename S1, int O1, typename _Constraint>
183  struct MultiplicationOp<InertiaTpl<S1,O1>, ScaledConstraint<_Constraint> >
184  {
187  typedef typename Constraint::Scalar Scalar;
188 
190 // typedef typename ScalarMatrixProduct<Scalar,OriginalReturnType>::type ReturnType;
191  typedef OriginalReturnType ReturnType;
192  };
193 
194  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
195  namespace impl
196  {
197  template<typename S1, int O1, typename _Constraint>
198  struct LhsMultiplicationOp<InertiaTpl<S1,O1>, ScaledConstraint<_Constraint> >
199  {
203 
204  static inline ReturnType run(const Inertia & Y,
205  const Constraint & scaled_constraint)
206  {
207  return scaled_constraint.scaling() * (Y * scaled_constraint.constraint());
208  }
209  };
210  } // namespace impl
211 
212  template<typename M6Like, typename _Constraint>
213  struct MultiplicationOp<Eigen::MatrixBase<M6Like>, ScaledConstraint<_Constraint> >
214  {
216  typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(OriginalReturnType) ReturnType;
217  };
218 
219  /* [ABA] operator* (Inertia Y,Constraint S) */
220  namespace impl
221  {
222  template<typename M6Like, typename _Constraint>
223  struct LhsMultiplicationOp<Eigen::MatrixBase<M6Like>, ScaledConstraint<_Constraint> >
224  {
227 
228  static inline ReturnType run(const Eigen::MatrixBase<M6Like> & Y,
229  const Constraint & scaled_constraint)
230  {
231  return scaled_constraint.scaling() * (Y.derived() * scaled_constraint.constraint());
232  }
233  };
234  } // namespace impl
235 
236  template<class Joint> struct JointMimic;
237  template<class JointModel> struct JointModelMimic;
238  template<class JointData> struct JointDataMimic;
239 
240  template<class Joint>
242  {
243  enum
244  {
247  };
248  typedef typename traits<Joint>::Scalar Scalar;
250 
253 
256 
260  typedef typename traits<Joint>::Bias_t Bias_t;
261 
262  // [ABA]
263  typedef typename traits<Joint>::U_t U_t;
264  typedef typename traits<Joint>::D_t D_t;
265  typedef typename traits<Joint>::UD_t UD_t;
266 
268 
271  };
272 
273  template<class Joint>
276 
277  template<class Joint>
280 
281  template<class JointData>
282  struct JointDataMimic
283  : public JointDataBase< JointDataMimic<JointData> >
284  {
285  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
286 
289 
291 
293  : m_scaling((Scalar)0)
294  , m_q_transform(ConfigVector_t::Zero())
295  , m_v_transform(TangentVector_t::Zero())
296  , S((Scalar)0)
297  {}
298 
300  { *this = other; }
301 
303  const Scalar & scaling)
304  : m_jdata_ref(jdata.derived())
305  , m_scaling(scaling)
306  , S(m_jdata_ref.S,scaling)
307  {}
308 
310  {
311  m_jdata_ref = other.m_jdata_ref;
312  m_scaling = other.m_scaling;
313  m_q_transform = other.m_q_transform;
314  m_v_transform = other.m_v_transform;
315  S = Constraint_t(m_jdata_ref.S,other.m_scaling);
316  return *this;
317  }
318 
319  using Base::isEqual;
320  bool isEqual(const JointDataMimic & other) const
321  {
322  return Base::isEqual(other)
323  && m_jdata_ref == other.m_jdata_ref
324  && m_scaling == other.m_scaling
325  && m_q_transform == other.m_q_transform
326  && m_v_transform == other.m_v_transform
327  ;
328  }
329 
330  static std::string classname()
331  {
332  return std::string("JointDataMimic<") + JointData::classname() + std::string(">");
333  }
334 
335  std::string shortname() const
336  {
337  return std::string("JointDataMimic<") + m_jdata_ref.shortname() + std::string(">");
338  }
339 
340  // Accessors
341  ConstraintTypeConstRef S_accessor() const { return S; }
342  ConstraintTypeRef S_accessor() { return S; }
343 
344  TansformTypeConstRef M_accessor() const { return m_jdata_ref.M; }
345  TansformTypeRef M_accessor() { return m_jdata_ref.M; }
346 
347  MotionTypeConstRef v_accessor() const { return m_jdata_ref.v; }
348  MotionTypeRef v_accessor() { return m_jdata_ref.v; }
349 
350  BiasTypeConstRef c_accessor() const { return m_jdata_ref.c; }
351  BiasTypeRef c_accessor() { return m_jdata_ref.c; }
352 
353  UTypeConstRef U_accessor() const { return m_jdata_ref.U; }
354  UTypeRef U_accessor() { return m_jdata_ref.U; }
355 
356  DTypeConstRef Dinv_accessor() const { return m_jdata_ref.Dinv; }
357  DTypeRef Dinv_accessor() { return m_jdata_ref.Dinv; }
358 
359  UDTypeConstRef UDinv_accessor() const { return m_jdata_ref.UDinv; }
360  UDTypeRef UDinv_accessor() { return m_jdata_ref.UDinv; }
361 
362  template<class JointModel>
363  friend struct JointModelMimic;
364 
365  const JointData & jdata() const { return m_jdata_ref; }
366  JointData & jdata() { return m_jdata_ref; }
367 
368  const Scalar & scaling() const { return m_scaling; }
369  Scalar & scaling() { return m_scaling; }
370 
371  ConfigVector_t & jointConfiguration() { return m_q_transform; }
372  const ConfigVector_t & jointConfiguration() const { return m_q_transform; }
373 
374  TangentVector_t & jointVelocity() { return m_v_transform; }
375  const TangentVector_t & jointVelocity() const { return m_v_transform; }
376 
377  protected:
378 
381 
383  ConfigVector_t m_q_transform;
385  TangentVector_t m_v_transform;
386 
387  public:
388 
389  // data
390  Constraint_t S;
391 
392  }; // struct JointDataMimic
393 
394  template<typename NewScalar, typename JointModel>
395  struct CastType< NewScalar, JointModelMimic<JointModel> >
396  {
399  };
400 
401  template<class JointModel>
402  struct JointModelMimic
403  : public JointModelBase< JointModelMimic<JointModel> >
404  {
405  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
406 
408 
409  PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
410 
412  using Base::id;
413  using Base::idx_q;
414  using Base::idx_v;
415  using Base::nq;
416  using Base::nv;
417  using Base::setIndexes;
418 
420  {}
421 
423  const Scalar & scaling,
424  const Scalar & offset)
425  : m_jmodel_ref(jmodel.derived())
426  , m_scaling(scaling)
427  , m_offset(offset)
428  {}
429 
430  Base & base() { return *static_cast<Base*>(this); }
431  const Base & base() const { return *static_cast<const Base*>(this); }
432 
433  inline int nq_impl() const { return 0; }
434  inline int nv_impl() const { return 0; }
435 
436  inline int idx_q_impl() const { return m_jmodel_ref.idx_q(); }
437  inline int idx_v_impl() const { return m_jmodel_ref.idx_v(); }
438 
439  void setIndexes_impl(JointIndex id, int /*q*/, int /*v*/)
440  {
441  Base::i_id = id; // Only the id of the joint in the model is different.
442  Base::i_q = m_jmodel_ref.idx_q();
443  Base::i_v = m_jmodel_ref.idx_v();
444  }
445 
446  JointDataDerived createData() const
447  {
448  return JointDataDerived(m_jmodel_ref.createData(),scaling());
449  }
450 
451  template<typename ConfigVector>
452  EIGEN_DONT_INLINE
453  void calc(JointDataDerived & jdata,
454  const typename Eigen::MatrixBase<ConfigVector> & qs) const
455  {
456  typedef typename ConfigVectorAffineTransform<JointDerived>::Type AffineTransform;
457 
458  AffineTransform::run(qs.head(m_jmodel_ref.nq()),
459  m_scaling,m_offset,jdata.m_q_transform);
460  m_jmodel_ref.calc(jdata.m_jdata_ref,jdata.m_q_transform);
461  }
462 
463  template<typename ConfigVector, typename TangentVector>
464  EIGEN_DONT_INLINE
465  void calc(JointDataDerived & jdata,
466  const typename Eigen::MatrixBase<ConfigVector> & qs,
467  const typename Eigen::MatrixBase<TangentVector> & vs) const
468  {
469  typedef typename ConfigVectorAffineTransform<JointDerived>::Type AffineTransform;
470 
471  AffineTransform::run(qs.head(m_jmodel_ref.nq()),
472  m_scaling,m_offset,jdata.m_q_transform);
473  jdata.m_v_transform = m_scaling * vs.head(m_jmodel_ref.nv());
474  m_jmodel_ref.calc(jdata.m_jdata_ref,
475  jdata.m_q_transform,
476  jdata.m_v_transform);
477  }
478 
479  template<typename Matrix6Like>
480  void calc_aba(JointDataDerived & data,
481  const Eigen::MatrixBase<Matrix6Like> & I,
482  const bool update_I) const
483  {
484  // TODO: fixme
485  m_jmodel_ref.calc_aba(data.m_jdata_ref,
486  PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I),
487  update_I);
488  }
489 
490  static std::string classname()
491  {
492  return std::string("JointModelMimic<") + JointModel::classname() + std::string(">");;
493  }
494 
495  std::string shortname() const
496  {
497  return std::string("JointModelMimic<") + m_jmodel_ref.shortname() + std::string(">");
498  }
499 
501  template<typename NewScalar>
503  {
504  typedef typename CastType<NewScalar,JointModelMimic>::type ReturnType;
505 
506  ReturnType res(m_jmodel_ref.template cast<NewScalar>(),
507  (NewScalar)m_scaling,
508  (NewScalar)m_offset);
509  res.setIndexes(id(),idx_q(),idx_v());
510  return res;
511  }
512 
513  const JointModel & jmodel() const { return m_jmodel_ref; }
514  JointModel & jmodel() { return m_jmodel_ref; }
515 
516  const Scalar & scaling() const { return m_scaling; }
517  Scalar & scaling() { return m_scaling; }
518 
519  const Scalar & offset() const { return m_offset; }
520  Scalar & offset() { return m_offset; }
521 
522  protected:
523 
524  // data
526  Scalar m_scaling, m_offset;
527 
528  public:
529 
530  /* Acces to dedicated segment in robot config space. */
531  // Const access
532  template<typename D>
533  typename SizeDepType<NQ>::template SegmentReturn<D>::ConstType
534  jointConfigSelector_impl(const Eigen::MatrixBase<D> & a) const
535  {
536  return SizeDepType<NQ>::segment(a.derived(),
537  m_jmodel_ref.idx_q(),
538  m_jmodel_ref.nq());
539  }
540 
541  // Non-const access
542  template<typename D>
543  typename SizeDepType<NQ>::template SegmentReturn<D>::Type
544  jointConfigSelector_impl(Eigen::MatrixBase<D> & a) const
545  {
546  return SizeDepType<NQ>::segment(a.derived(),
547  m_jmodel_ref.idx_q(),
548  m_jmodel_ref.nq());
549  }
550 
551  /* Acces to dedicated segment in robot config velocity space. */
552  // Const access
553  template<typename D>
554  typename SizeDepType<NV>::template SegmentReturn<D>::ConstType
555  jointVelocitySelector_impl(const Eigen::MatrixBase<D> & a) const
556  {
557  return SizeDepType<NV>::segment(a.derived(),
558  m_jmodel_ref.idx_v(),
559  m_jmodel_ref.nv());
560  }
561 
562  // Non-const access
563  template<typename D>
564  typename SizeDepType<NV>::template SegmentReturn<D>::Type
565  jointVelocitySelector_impl(Eigen::MatrixBase<D> & a) const
566  {
567  return SizeDepType<NV>::segment(a.derived(),
568  m_jmodel_ref.idx_v(),
569  m_jmodel_ref.nv());
570  }
571 
572  /* Acces to dedicated columns in a ForceSet or MotionSet matrix.*/
573  // Const access
574  template<typename D>
575  typename SizeDepType<NV>::template ColsReturn<D>::ConstType
576  jointCols_impl(const Eigen::MatrixBase<D> & A) const
577  {
578  return SizeDepType<NV>::middleCols(A.derived(),
579  m_jmodel_ref.idx_v(),
580  m_jmodel_ref.nv());
581  }
582 
583  // Non-const access
584  template<typename D>
585  typename SizeDepType<NV>::template ColsReturn<D>::Type
586  jointCols_impl(Eigen::MatrixBase<D> & A) const
587  {
588  return SizeDepType<NV>::middleCols(A.derived(),
589  m_jmodel_ref.idx_v(),
590  m_jmodel_ref.nv());
591  }
592 
593  /* Acces to dedicated rows in a matrix.*/
594  // Const access
595  template<typename D>
596  typename SizeDepType<NV>::template RowsReturn<D>::ConstType
597  jointRows_impl(const Eigen::MatrixBase<D> & A) const
598  {
599  return SizeDepType<NV>::middleRows(A.derived(),
600  m_jmodel_ref.idx_v(),
601  m_jmodel_ref.nv());
602  }
603 
604  // Non-const access
605  template<typename D>
606  typename SizeDepType<NV>::template RowsReturn<D>::Type
607  jointRows_impl(Eigen::MatrixBase<D> & A) const
608  {
609  return SizeDepType<NV>::middleRows(A.derived(),
610  m_jmodel_ref.idx_v(),
611  m_jmodel_ref.nv());
612  }
613 
615  // Const access
616  template<typename D>
617  typename SizeDepType<NV>::template BlockReturn<D>::ConstType
618  jointBlock_impl(const Eigen::MatrixBase<D> & Mat) const
619  {
620  return SizeDepType<NV>::block(Mat.derived(),
621  m_jmodel_ref.idx_v(),m_jmodel_ref.idx_v(),
622  m_jmodel_ref.nv(),m_jmodel_ref.nv());
623  }
624 
625  // Non-const access
626  template<typename D>
627  typename SizeDepType<NV>::template BlockReturn<D>::Type
628  jointBlock_impl(Eigen::MatrixBase<D> & Mat) const
629  {
630  return SizeDepType<NV>::block(Mat.derived(),
631  m_jmodel_ref.idx_v(),m_jmodel_ref.idx_v(),
632  m_jmodel_ref.nv(),m_jmodel_ref.nv());
633  }
634 
635  }; // struct JointModelMimic
636 
637 } // namespace pinocchio
638 
639 #endif // ifndef __pinocchio_multibody_joint_mimic_hpp__
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
UDTypeConstRef UDinv_accessor() const
traits< Joint >::Motion_t Motion_t
std::string shortname() const
int nv(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNvVisitor to get the dimension of the joint tangent space...
Forward declaration of the multiplication operation return type. Should be overloaded, otherwise it will procude a compilation error.
Definition: binary-op.hpp:15
Linear affine transformation of the configuration vector. Valide for most common joints which are evo...
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef traits< JointModelMimic >::JointDerived JointDerived
JointModelBase< JointModelMimic > Base
const Base & base() const
int NQ
Definition: dpendulum.py:8
int idx_q(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxQVisitor to get the index in the full model configuration space...
Eigen::Matrix< Scalar, Constraint::NV, ForceSet::ColsAtCompileTime, Constraint::Options|Eigen::RowMajor > ReturnType
Definition: joint-mimic.hpp:56
ConfigVector_t m_q_transform
Transform configuration vector.
SE3GroupAction< Constraint >::ReturnType SE3ActionReturnType
Definition: joint-mimic.hpp:70
int idx_v(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxVVisitor to get the index in the full model tangent space corre...
Return type of the Constraint::Transpose * ForceSet operation.
const Scalar & scaling() const
TangentVector_t m_v_transform
Transform velocity vector.
int nq(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNqVisitor to get the dimension of the joint configuration space...
Return type of the ation of a Motion onto an object of type D.
SizeDepType< NV >::template BlockReturn< D >::Type jointBlock_impl(Eigen::MatrixBase< D > &Mat) const
MultiplicationOp< Eigen::MatrixBase< M6Like >, Constraint >::ReturnType ReturnType
ConstraintForceSetOp< Constraint, ForceSet >::ReturnType OriginalReturnType
Definition: joint-mimic.hpp:54
ConfigVector_t & jointConfiguration()
SE3ActionReturnType se3Action(const SE3Tpl< S1, O1 > &m) const
TangentVector_t & jointVelocity()
JointIndex id(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdVisitor to get the index of the joint in the kinematic chain...
TansformTypeConstRef M_accessor() const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef traits< JointDataMimic >::JointDerived JointDerived
SizeDepType< NV >::template ColsReturn< D >::ConstType jointCols_impl(const Eigen::MatrixBase< D > &A) const
traits< Constraint >::ConstMatrixReturnType ConstMatrixReturnType
Definition: joint-mimic.hpp:29
JointMotion __mult__(const Eigen::MatrixBase< VectorLike > &v) const
Definition: joint-mimic.hpp:97
void setIndexes_impl(JointIndex id, int, int)
SizeDepType< NV >::template BlockReturn< D >::ConstType jointBlock_impl(const Eigen::MatrixBase< D > &Mat) const
Returns a block of dimension nv()xnv() located at position idx_v(),idx_v() in the matrix Mat...
CastType< NewScalar, JointModelMimic >::type cast() const
SizeDepType< NQ >::template SegmentReturn< D >::Type jointConfigSelector_impl(Eigen::MatrixBase< D > &a) const
ScaledConstraint< typename traits< Joint >::Constraint_t > Constraint_t
CastType< NewScalar, JointModel >::type JointModelNewType
SizeDepType< NV >::template ColsReturn< D >::Type jointCols_impl(Eigen::MatrixBase< D > &A) const
JointMimic< typename traits< Joint >::JointDerived > JointDerived
PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE typedef traits< Joint >::ConfigVector_t ConfigVector_t
bool isEqual(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel_generic, const JointModelBase< JointModelDerived > &jmodel)
Visit a JointModelTpl<Scalar,...> to compare it to JointModelDerived.
BiasTypeConstRef c_accessor() const
EIGEN_DONT_INLINE void calc(JointDataDerived &jdata, const typename Eigen::MatrixBase< ConfigVector > &qs, const typename Eigen::MatrixBase< TangentVector > &vs) const
#define PINOCCHIO_EIGEN_CONST_CAST(TYPE, OBJ)
Macro for an automatic const_cast.
ConstraintForceOp< Constraint, ForceDerived >::ReturnType OriginalReturnType
Definition: joint-mimic.hpp:44
SizeDepType< NV >::template RowsReturn< D >::ConstType jointRows_impl(const Eigen::MatrixBase< D > &A) const
JointDataMimic(const JointDataMimic &other)
SE3::Scalar Scalar
Definition: conversions.cpp:13
JointModelMimic< JointModelBase > JointModelDerived
static BlockReturn< D >::ConstType block(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index row_id, typename Eigen::DenseBase< D >::Index col_id, typename Eigen::DenseBase< D >::Index row_size_block=NV, typename Eigen::DenseBase< D >::Index col_size_block=NV)
MultiplicationOp< Inertia, _Constraint >::ReturnType OriginalReturnType
DTypeConstRef Dinv_accessor() const
const TangentVector_t & jointVelocity() const
const Scalar & offset() const
MotionTypeConstRef v_accessor() const
#define PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE
const Scalar & scaling() const
static ReturnType run(const Inertia &Y, const Constraint &scaled_constraint)
traits< Joint >::JointModelDerived JointModelBase
ConstraintTypeRef S_accessor()
ScaledConstraint(const ScaledConstraint &other)
Definition: joint-mimic.hpp:84
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint)
void calc_aba(JointDataDerived &data, const Eigen::MatrixBase< Matrix6Like > &I, const bool update_I) const
JointMimic< typename traits< Joint >::JointDerived > JointDerived
ScaledConstraint & operator=(const ScaledConstraint &other)
Definition: joint-mimic.hpp:89
const Scalar & scaling() const
traits< Joint >::JointDataDerived JointDataBase
MotionTypeRef v_accessor()
Eigen::Matrix< Scalar, IdealReturnType::RowsAtCompileTime, IdealReturnType::ColsAtCompileTime, Constraint::Options > ReturnType
Definition: joint-mimic.hpp:47
UTypeConstRef U_accessor() const
JointDataMimic(const JointDataBase< JointData > &jdata, const Scalar &scaling)
traits< Constraint >::JointForce JointForce
Definition: joint-mimic.hpp:26
ScaledConstraint(const Constraint &constraint, const Scalar &scaling_factor)
Definition: joint-mimic.hpp:78
ConstraintForceSetOp< ScaledConstraint, Derived >::ReturnType operator*(const Eigen::MatrixBase< Derived > &F) const
[CRBA] MatrixBase operator* (Constraint::Transpose S, ForceSet::Block)
JointDataMimic< JointDataBase > JointDataDerived
SizeDepType< NV >::template RowsReturn< D >::Type jointRows_impl(Eigen::MatrixBase< D > &A) const
SizeDepType< NV >::template SegmentReturn< D >::Type jointVelocitySelector_impl(Eigen::MatrixBase< D > &a) const
static ReturnType run(const Eigen::MatrixBase< M6Like > &Y, const Constraint &scaled_constraint)
static ColsReturn< D >::ConstType middleCols(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
TransposeConst transpose() const
Main pinocchio namespace.
Definition: timings.cpp:30
std::string shortname() const
JointDataMimic & operator=(const JointDataMimic &other)
ScalarMatrixProduct< Scalar, OriginalReturnType >::type IdealReturnType
Definition: joint-mimic.hpp:46
static std::string classname()
traits< Constraint >::JointMotion JointMotion
Definition: joint-mimic.hpp:25
traits< Constraint >::MatrixReturnType MatrixReturnType
Definition: joint-mimic.hpp:28
DenseBase matrix_impl() const
traits< Joint >::TangentVector_t TangentVector_t
PINOCCHIO_EIGEN_PLAIN_TYPE(ConfigVectorType) integrate(const ModelTpl< Scalar
Integrate a configuration vector for the specified model for a tangent vector during one unit time...
res
void setIndexes(JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointIndex id, int q, int v)
Visit a JointModelTpl through JointSetIndexesVisitor to set the indexes of the joint in the kinematic...
ScaledConstraint(const Scalar &scaling_factor)
Definition: joint-mimic.hpp:74
Common traits structure to fully define base classes for CRTP.
Definition: src/fwd.hpp:44
ScalarMatrixProduct< Scalar, OriginalReturnType >::type IdealReturnType
Definition: joint-mimic.hpp:55
traits< Joint >::Transformation_t Transformation_t
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_multiple_op< Scalar >, const Matrix > type
Definition: math/matrix.hpp:82
const ConfigVector_t & jointConfiguration() const
const JointModel & jmodel() const
#define PINOCCHIO_CONSTRAINT_TYPEDEF_TPL(DERIVED)
MotionAlgebraAction< ScaledConstraint, MotionDerived >::ReturnType motionAction(const MotionDense< MotionDerived > &m) const
static std::string classname()
EIGEN_DONT_INLINE void calc(JointDataDerived &jdata, const typename Eigen::MatrixBase< ConfigVector > &qs) const
MotionAlgebraAction< Constraint, MotionDerived >::ReturnType ReturnType
Definition: joint-mimic.hpp:38
bool isEqual(const JointDataMimic &other) const
static RowsReturn< D >::ConstType middleRows(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
JointModelMimic(const JointModelBase< JointModel > &jmodel, const Scalar &scaling, const Scalar &offset)
const JointData & jdata() const
NV
Definition: dcrba.py:444
static SegmentReturn< D >::ConstType segment(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
ConstraintForceOp< ScaledConstraint, Derived >::ReturnType operator*(const ForceDense< Derived > &f) const
bool isEqual(const ScaledConstraint &other) const
JointDataDerived createData() const
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type...
Definition: src/fwd.hpp:55
JointDataBase< JointDataMimic< JointData > > Base
TansformTypeRef M_accessor()
SE3ActionReturnType se3ActionInverse(const SE3Tpl< S1, O1 > &m) const
Return type of the Constraint::Transpose * Force operation.
SizeDepType< NV >::template SegmentReturn< D >::ConstType jointVelocitySelector_impl(const Eigen::MatrixBase< D > &a) const
ConstraintTypeConstRef S_accessor() const
TransposeConst(const ScaledConstraint &ref)
ReturnTypeNotDefined ReturnType
SizeDepType< NQ >::template SegmentReturn< D >::ConstType jointConfigSelector_impl(const Eigen::MatrixBase< D > &a) const
ConstraintBase< ScaledConstraint > Base
Definition: joint-mimic.hpp:67
const Constraint & constraint() const
SE3GroupAction< Constraint >::ReturnType ReturnType
Definition: joint-mimic.hpp:34
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint)


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:03