6 #ifndef __pinocchio_multibody_joint_data_base_hpp__
7 #define __pinocchio_multibody_joint_data_base_hpp__
9 #include "pinocchio/multibody/joint/joint-base.hpp"
10 #include "pinocchio/multibody/joint/joint-model-base.hpp"
12 #define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, TYPENAME) \
13 PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint, TYPENAME); \
14 typedef TYPENAME traits<Joint>::ConfigVectorTypeConstRef ConfigVectorTypeConstRef; \
15 typedef TYPENAME traits<Joint>::ConfigVectorTypeRef ConfigVectorTypeRef; \
16 typedef TYPENAME traits<Joint>::TangentVectorTypeConstRef TangentVectorTypeConstRef; \
17 typedef TYPENAME traits<Joint>::TangentVectorTypeRef TangentVectorTypeRef; \
18 typedef TYPENAME traits<Joint>::ConstraintTypeConstRef ConstraintTypeConstRef; \
19 typedef TYPENAME traits<Joint>::ConstraintTypeRef ConstraintTypeRef; \
20 typedef TYPENAME traits<Joint>::TansformTypeConstRef TansformTypeConstRef; \
21 typedef TYPENAME traits<Joint>::TansformTypeRef TansformTypeRef; \
22 typedef TYPENAME traits<Joint>::MotionTypeConstRef MotionTypeConstRef; \
23 typedef TYPENAME traits<Joint>::MotionTypeRef MotionTypeRef; \
24 typedef TYPENAME traits<Joint>::BiasTypeConstRef BiasTypeConstRef; \
25 typedef TYPENAME traits<Joint>::BiasTypeRef BiasTypeRef; \
26 typedef TYPENAME traits<Joint>::UTypeConstRef UTypeConstRef; \
27 typedef TYPENAME traits<Joint>::UTypeRef UTypeRef; \
28 typedef TYPENAME traits<Joint>::DTypeConstRef DTypeConstRef; \
29 typedef TYPENAME traits<Joint>::DTypeRef DTypeRef; \
30 typedef TYPENAME traits<Joint>::UDTypeConstRef UDTypeConstRef; \
31 typedef TYPENAME traits<Joint>::UDTypeRef UDTypeRef
35 #define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) \
36 PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, PINOCCHIO_EMPTY_ARG)
37 #define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) \
38 PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, typename)
40 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) && (__GNUC_PATCHLEVEL__ == 2)
42 #define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) \
43 PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, PINOCCHIO_EMPTY_ARG)
44 #define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) \
45 PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, typename)
49 #define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, typename)
50 #define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) \
51 PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint, typename)
55 #define PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR \
56 ConfigVectorTypeConstRef joint_q_accessor() const \
60 ConfigVectorTypeRef joint_q_accessor() \
64 TangentVectorTypeConstRef joint_v_accessor() const \
68 TangentVectorTypeRef joint_v_accessor() \
72 ConstraintTypeConstRef S_accessor() const \
76 ConstraintTypeRef S_accessor() \
80 TansformTypeConstRef M_accessor() const \
84 TansformTypeRef M_accessor() \
88 MotionTypeConstRef v_accessor() const \
92 MotionTypeRef v_accessor() \
96 BiasTypeConstRef c_accessor() const \
100 BiasTypeRef c_accessor() \
104 UTypeConstRef U_accessor() const \
108 UTypeRef U_accessor() \
112 DTypeConstRef Dinv_accessor() const \
116 DTypeRef Dinv_accessor() \
120 UDTypeConstRef UDinv_accessor() const \
124 UDTypeRef UDinv_accessor() \
128 DTypeConstRef StU_accessor() const \
132 DTypeRef StU_accessor() \
137 #define PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE \
138 typedef const ConfigVector_t & ConfigVectorTypeConstRef; \
139 typedef ConfigVector_t & ConfigVectorTypeRef; \
140 typedef const TangentVector_t & TangentVectorTypeConstRef; \
141 typedef TangentVector_t & TangentVectorTypeRef; \
142 typedef const Constraint_t & ConstraintTypeConstRef; \
143 typedef Constraint_t & ConstraintTypeRef; \
144 typedef const Transformation_t & TansformTypeConstRef; \
145 typedef Transformation_t & TansformTypeRef; \
146 typedef const Motion_t & MotionTypeConstRef; \
147 typedef Motion_t & MotionTypeRef; \
148 typedef const Bias_t & BiasTypeConstRef; \
149 typedef Bias_t & BiasTypeRef; \
150 typedef const U_t & UTypeConstRef; \
151 typedef U_t & UTypeRef; \
152 typedef const D_t & DTypeConstRef; \
153 typedef D_t & DTypeRef; \
154 typedef const UD_t & UDTypeConstRef; \
155 typedef UD_t & UDTypeRef;
160 template<
typename Derived>
163 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
166 PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
170 return *
static_cast<Derived *
>(
this);
172 const Derived & derived()
const
174 return *
static_cast<const Derived *
>(
this);
177 ConfigVectorTypeConstRef joint_q()
const
179 return derived().joint_q_accessor();
181 ConfigVectorTypeRef joint_q()
183 return derived().joint_q_accessor();
186 TangentVectorTypeConstRef joint_v()
const
188 return derived().joint_v_accessor();
190 TangentVectorTypeRef joint_v()
192 return derived().joint_v_accessor();
195 ConstraintTypeConstRef S()
const
197 return derived().S_accessor();
199 ConstraintTypeRef S()
201 return derived().S_accessor();
203 TansformTypeConstRef M()
const
205 return derived().M_accessor();
209 return derived().M_accessor();
211 MotionTypeConstRef v()
const
213 return derived().v_accessor();
217 return derived().v_accessor();
219 BiasTypeConstRef c()
const
221 return derived().c_accessor();
225 return derived().c_accessor();
228 UTypeConstRef U()
const
230 return derived().U_accessor();
234 return derived().U_accessor();
236 DTypeConstRef Dinv()
const
238 return derived().Dinv_accessor();
242 return derived().Dinv_accessor();
244 UDTypeConstRef UDinv()
const
246 return derived().UDinv_accessor();
250 return derived().UDinv_accessor();
252 DTypeConstRef StU()
const
254 return derived().StU_accessor();
258 return derived().StU_accessor();
261 std::string shortname()
const
263 return derived().shortname();
265 static std::string classname()
267 return Derived::classname();
270 void disp(std::ostream & os)
const
282 template<
typename OtherDerived>
285 return derived().isEqual(other.derived());
291 return internal::comparison_eq(joint_q(), other.joint_q())
292 && internal::comparison_eq(joint_v(), other.joint_v())
293 && internal::comparison_eq(S(), other.S()) && internal::comparison_eq(M(), other.M())
294 && internal::comparison_eq(v(), other.v()) && internal::comparison_eq(c(), other.c())
295 && internal::comparison_eq(U(), other.U())
296 && internal::comparison_eq(Dinv(), other.Dinv())
297 && internal::comparison_eq(UDinv(), other.UDinv());
301 template<
typename OtherDerived>
310 return derived().isNotEqual(other.derived());
316 return !(internal::comparison_eq(derived(), other.derived()));
Main pinocchio namespace.
std::string shortname(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointShortnameVisitor to get the shortname of the derived joint model.
bool isNotEqual(const JointDataBase< Derived > &other) const
 
bool isEqual(const JointDataBase< OtherDerived > &) const
 
JointDataBase()
Default constructor: protected.
bool isEqual(const JointDataBase< Derived > &other) const
 
Common traits structure to fully define base classes for CRTP.