pinocchio  2.3.1-dirty
joint-basic-visitors.hpp
1 //
2 // Copyright (c) 2016,2018 CNRS
3 //
4 
5 #ifndef __pinocchio_joint_basic_visitors_hpp__
6 #define __pinocchio_joint_basic_visitors_hpp__
7 
8 #include "pinocchio/multibody/joint/fwd.hpp"
9 
10 namespace pinocchio
11 {
12 
22  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
23  inline JointDataTpl<Scalar,Options,JointCollectionTpl>
24  createData(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
25 
26 
38  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl, typename ConfigVectorType>
39  inline void calc_zero_order(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel,
40  JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata,
41  const Eigen::MatrixBase<ConfigVectorType> & q);
42 
55  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl, typename ConfigVectorType, typename TangentVectorType>
56  inline void calc_first_order(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel,
57  JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata,
58  const Eigen::MatrixBase<ConfigVectorType> & q,
59  const Eigen::MatrixBase<TangentVectorType> & v);
60 
61 
73  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl, typename Matrix6Type>
74  inline void calc_aba(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel,
75  JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata,
76  const Eigen::MatrixBase<Matrix6Type> & I,
77  const bool update_I);
78 
87  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
88  inline int nv(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
89 
90 
91 
100  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
101  inline int nq(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
102 
103 
113  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
114  inline int idx_q(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
115 
116 
126  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
127  inline int idx_v(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
128 
129 
137  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
138  inline JointIndex id(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
139 
151  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
152  inline void setIndexes(JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel, JointIndex id, int q,int v);
153 
154 
160  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
161  inline std::string shortname(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
162 
172  template<typename NewScalar, typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
173  typename CastType< NewScalar,JointModelTpl<Scalar,Options,JointCollectionTpl> >::type
174  cast_joint(const JointModelTpl<Scalar,Options,JointCollectionTpl> & jmodel);
175 
176 
177  //
178  // Visitors on JointDatas
179  //
180 
181 
190  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
191  inline ConstraintTpl<Eigen::Dynamic,Scalar,Options>
192  constraint_xd(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
193 
202  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
203  inline SE3Tpl<Scalar,Options>
204  joint_transform(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
205 
214  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
215  inline MotionTpl<Scalar,Options>
216  motion(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
217 
226  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
227  inline MotionTpl<Scalar,Options>
228  bias(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
229 
238  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
239  inline Eigen::Matrix<Scalar,6,Eigen::Dynamic,Options>
240  u_inertia(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
241 
250  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
251  inline Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic,Options>
252  dinv_inertia(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
253 
262  template<typename Scalar, int Options, template<typename S, int O> class JointCollectionTpl>
263  inline Eigen::Matrix<Scalar,6,Eigen::Dynamic,Options>
264  udinv_inertia(const JointDataTpl<Scalar,Options,JointCollectionTpl> & jdata);
265 
266 } // namespace pinocchio
267 
268 
269 /* --- Details -------------------------------------------------------------------- */
270 // Included later
271 // #include "pinocchio/multibody/joint/joint-basic-visitors.hxx"
272 
273 
274 #endif // ifndef __pinocchio_joint_basic_visitors_hpp__
int nv(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNvVisitor to get the dimension of the joint tangent space...
MotionTpl< Scalar, Options > motion(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointMotionVisitor to get the joint internal motion as a dense motion...
int idx_q(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxQVisitor to get the index in the full model configuration space...
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...
int nq(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNqVisitor to get the dimension of the joint configuration space...
JointDataTpl< Scalar, Options, JointCollectionTpl > createData(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through CreateData visitor to create a JointDataTpl.
SE3Tpl< Scalar, Options > joint_transform(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointTransformVisitor to get the joint internal transform (transform bet...
JointIndex id(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdVisitor to get the index of the joint in the kinematic chain...
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > udinv_inertia(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointUDInvInertiaVisitor to get U*D^{-1} matrix of the inertia matrix de...
std::string shortname(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointShortnameVisitor to get the shortname of the derived joint model...
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > u_inertia(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointUInertiaVisitor to get the U matrix of the inertia matrix decomposi...
Main pinocchio namespace.
Definition: treeview.dox:24
CastType< NewScalar, JointModelTpl< Scalar, Options, JointCollectionTpl > >::type cast_joint(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl<Scalar,...> to cast it into JointModelTpl<NewScalar,...>
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...
MotionTpl< Scalar, Options > bias(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointBiasVisitor to get the joint bias as a dense motion.
void calc_first_order(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Visit a JointModelTpl and the corresponding JointDataTpl through JointCalcFirstOrderVisitor to comput...
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Options > dinv_inertia(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointDInvInertiaVisitor to get the D^{-1} matrix of the inertia matrix d...
ConstraintTpl< Eigen::Dynamic, Scalar, Options > constraint_xd(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataVariant through JointConstraintVisitor to get the joint constraint as a dense constr...
void calc_aba(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata, const Eigen::MatrixBase< Matrix6Type > &I, const bool update_I)
Visit a JointModelTpl and the corresponding JointDataTpl through JointCalcAbaVisitor to...
void calc_zero_order(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata, const Eigen::MatrixBase< ConfigVectorType > &q)
Visit a JointModelTpl and the corresponding JointDataTpl through JointCalcZeroOrderVisitor to compute...