Go to the documentation of this file.
6 #ifndef __pinocchio_multibody_joint_model_base_hpp__
7 #define __pinocchio_multibody_joint_model_base_hpp__
16 #define PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, TYPENAME) \
17 typedef Eigen::DenseIndex Index; \
18 typedef TYPENAME traits<Joint>::Scalar Scalar; \
19 typedef TYPENAME traits<Joint>::JointDataDerived JointDataDerived; \
20 typedef TYPENAME traits<Joint>::JointModelDerived JointModelDerived; \
21 typedef TYPENAME traits<Joint>::Constraint_t Constraint_t; \
22 typedef TYPENAME traits<Joint>::Transformation_t Transformation_t; \
23 typedef TYPENAME traits<Joint>::Motion_t Motion_t; \
24 typedef TYPENAME traits<Joint>::Bias_t Bias_t; \
25 typedef TYPENAME traits<Joint>::U_t U_t; \
26 typedef TYPENAME traits<Joint>::D_t D_t; \
27 typedef TYPENAME traits<Joint>::UD_t UD_t; \
30 Options = traits<Joint>::Options, \
31 NQ = traits<Joint>::NQ, \
32 NV = traits<Joint>::NV \
34 typedef TYPENAME traits<Joint>::ConfigVector_t ConfigVector_t; \
35 typedef TYPENAME traits<Joint>::TangentVector_t TangentVector_t
39 #define PINOCCHIO_JOINT_TYPEDEF(Joint) \
40 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, PINOCCHIO_EMPTY_ARG)
41 #define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) \
42 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, typename)
44 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) && (__GNUC_PATCHLEVEL__ == 2)
46 #define PINOCCHIO_JOINT_TYPEDEF(Joint) \
47 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, PINOCCHIO_EMPTY_ARG)
48 #define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) \
49 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, typename)
53 #define PINOCCHIO_JOINT_TYPEDEF(Joint) PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, typename)
54 #define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) \
55 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, typename)
59 #define PINOCCHIO_JOINT_USE_INDEXES(Joint) \
60 typedef JointModelBase<Joint> Base; \
64 #define PINOCCHIO_JOINT_CAST_TYPE_SPECIALIZATION(JointModelTpl) \
65 template<typename Scalar, int Options, typename NewScalar> \
66 struct CastType<NewScalar, JointModelTpl<Scalar, Options>> \
68 typedef JointModelTpl<NewScalar, Options> type; \
74 template<
typename Derived>
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84 return *
static_cast<Derived *
>(
this);
88 return *
static_cast<const Derived *
>(
this);
98 return derived().hasConfigurationLimit();
103 return derived().hasConfigurationLimitInTangent();
106 template<
typename ConfigVectorType>
107 void calc(JointDataDerived &
data,
const Eigen::MatrixBase<ConfigVectorType> &
qs)
const
112 template<
typename TangentVectorType>
114 JointDataDerived &
data,
115 const Blank not_used,
116 const Eigen::MatrixBase<TangentVectorType> & vs)
const
121 template<
typename ConfigVectorType,
typename TangentVectorType>
123 JointDataDerived &
data,
124 const Eigen::MatrixBase<ConfigVectorType> &
qs,
125 const Eigen::MatrixBase<TangentVectorType> & vs)
const
130 template<
typename VectorLike,
typename Matrix6Like>
132 JointDataDerived &
data,
133 const Eigen::MatrixBase<VectorLike> & armature,
134 const Eigen::MatrixBase<Matrix6Like> & I,
135 const bool update_I =
false)
const
197 void disp(std::ostream & os)
const
201 <<
" index: " <<
id() << endl
202 <<
" index q: " <<
idx_q() << endl
203 <<
" index v: " <<
idx_v() << endl
204 <<
" nq: " <<
nq() << endl
205 <<
" nv: " <<
nv() << endl;
220 return Derived::classname();
223 template<
typename NewScalar>
226 return derived().template cast<NewScalar>();
229 template<
class OtherDerived>
235 template<
class OtherDerived>
241 template<
class OtherDerived>
252 template<
class OtherDerived>
266 return derived().jointConfigSelector_impl(
a);
281 return derived().jointConfigSelector_impl(
a);
297 return derived().jointVelocitySelector_impl(
a.derived());
312 return derived().jointVelocitySelector_impl(
a.derived());
328 return derived().jointCols_impl(
A.derived());
342 return derived().jointCols_impl(
A.derived());
358 return derived().jointRows_impl(
A.derived());
372 return derived().jointRows_impl(
A.derived());
389 return derived().jointBlock_impl(Mat.derived());
404 return derived().jointBlock_impl(Mat.derived());
455 #endif // ifndef __pinocchio_multibody_joint_model_base_hpp__
JointModelBase(const JointModelBase &clone)
JointDataDerived createData() const
SizeDepType< NQ >::template SegmentReturn< D >::Type jointConfigSelector(Eigen::MatrixBase< D > &a) const
void calc(JointDataDerived &data, const Blank not_used, const Eigen::MatrixBase< TangentVectorType > &vs) const
SizeDepType< NV >::template RowsReturn< D >::ConstType jointRows(const Eigen::MatrixBase< D > &A) const
SizeDepType< NV >::template BlockReturn< D >::Type jointBlock_impl(Eigen::MatrixBase< D > &Mat) const
const std::vector< bool > hasConfigurationLimit() const
void setIndexes_impl(JointIndex id, int q, int v)
void calc(JointDataDerived &data, const Eigen::MatrixBase< ConfigVectorType > &qs, const Eigen::MatrixBase< TangentVectorType > &vs) const
bool hasSameIndexes(const JointModelBase< OtherDerived > &other) const
static ColsReturn< D >::ConstType middleCols(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
#define PINOCCHIO_EIGEN_CONST_CAST(TYPE, OBJ)
Macro for an automatic const_cast.
bool isEqual(const JointModelBase< Derived > &other) const
JointIndex id_impl() const
SizeDepType< NQ >::template SegmentReturn< D >::ConstType jointConfigSelector(const Eigen::MatrixBase< D > &a) const
CastType< NewScalar, Derived >::type cast() const
void setIndexes(JointIndex id, int q, int v)
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived)
SizeDepType< NV >::template RowsReturn< D >::Type jointRows(Eigen::MatrixBase< D > &A) const
SizeDepType< NV >::template SegmentReturn< D >::ConstType jointVelocitySelector(const Eigen::MatrixBase< D > &a) const
SizeDepType< NV >::template ColsReturn< D >::Type jointCols(Eigen::MatrixBase< D > &A) const
void calc_aba(JointDataDerived &data, const Eigen::MatrixBase< VectorLike > &armature, const Eigen::MatrixBase< Matrix6Like > &I, const bool update_I=false) const
SizeDepType< NQ >::template SegmentReturn< D >::Type jointConfigSelector_impl(Eigen::MatrixBase< D > &a) const
static std::string classname()
SizeDepType< NV >::template ColsReturn< D >::ConstType jointCols_impl(const Eigen::MatrixBase< D > &A) const
JointModelBase & operator=(const JointModelBase &clone)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef traits< Derived >::JointDerived JointDerived
std::string shortname() const
bool operator!=(const JointModelBase< OtherDerived > &other) const
bool operator==(const JointModelBase< OtherDerived > &other) const
const std::vector< bool > hasConfigurationLimitInTangent() const
static RowsReturn< D >::ConstType middleRows(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
static SegmentReturn< D >::ConstType segment(const Eigen::MatrixBase< D > &mat, typename Eigen::DenseBase< D >::Index start, typename Eigen::DenseBase< D >::Index size=NV)
SizeDepType< NV >::template SegmentReturn< D >::ConstType jointVelocitySelector_impl(const Eigen::MatrixBase< D > &a) const
SizeDepType< NV >::template BlockReturn< D >::ConstType jointBlock(const Eigen::MatrixBase< D > &Mat) const
Returns a block of dimension nv()xnv() located at position idx_v(),idx_v() in the matrix Mat.
SizeDepType< NV >::template RowsReturn< D >::Type jointRows_impl(Eigen::MatrixBase< D > &A) const
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
SizeDepType< NV >::template ColsReturn< D >::Type jointCols_impl(Eigen::MatrixBase< D > &A) const
friend std::ostream & operator<<(std::ostream &os, const JointModelBase< Derived > &joint)
virtual CollisionGeometry * clone() const=0
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
bool comparison_eq(const LhsType &lhs_value, const RhsType &rhs_value)
SizeDepType< NV >::template ColsReturn< D >::ConstType jointCols(const Eigen::MatrixBase< D > &A) const
SizeDepType< NV >::template RowsReturn< D >::ConstType jointRows_impl(const Eigen::MatrixBase< D > &A) const
void calc(JointDataDerived &data, const Eigen::MatrixBase< ConfigVectorType > &qs) const
SizeDepType< NV >::template BlockReturn< D >::Type jointBlock(Eigen::MatrixBase< D > &Mat) const
Common traits structure to fully define base classes for CRTP.
SizeDepType< NV >::template BlockReturn< D >::ConstType jointBlock_impl(const Eigen::MatrixBase< D > &Mat) const
SizeDepType< NV >::template SegmentReturn< D >::Type jointVelocitySelector(Eigen::MatrixBase< D > &a) const
SizeDepType< NQ >::template SegmentReturn< D >::ConstType jointConfigSelector_impl(const Eigen::MatrixBase< D > &a) const
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)
void disp(std::ostream &os) const
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type....
const JointModelDerived & derived() const
SizeDepType< NV >::template SegmentReturn< D >::Type jointVelocitySelector_impl(Eigen::MatrixBase< D > &a) const
AD< Scalar > max(const AD< Scalar > &x, const AD< Scalar > &y)
bool isEqual(const JointModelBase< OtherDerived > &) const
JointModelDerived & derived()
Main pinocchio namespace.
pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:30