Verified Commit 5c61b5ca authored by Justin Carpentier's avatar Justin Carpentier
Browse files

joints: redefine MACRO to take the Joint as argument

parent 5561f910
//
// Copyright (c) 2015-2018 CNRS INRIA
// Copyright (c) 2015-2019 CNRS INRIA
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
//
......@@ -12,60 +12,60 @@
#include <limits>
#define PINOCCHIO_JOINT_TYPEDEF_GENERIC(TYPENAME) \
#define PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,TYPENAME) \
typedef Eigen::DenseIndex Index; \
typedef TYPENAME traits<JointDerived>::Scalar Scalar; \
typedef TYPENAME traits<JointDerived>::JointDataDerived JointDataDerived; \
typedef TYPENAME traits<JointDerived>::JointModelDerived JointModelDerived; \
typedef TYPENAME traits<JointDerived>::Constraint_t Constraint_t; \
typedef TYPENAME traits<JointDerived>::Transformation_t Transformation_t; \
typedef TYPENAME traits<JointDerived>::Motion_t Motion_t; \
typedef TYPENAME traits<JointDerived>::Bias_t Bias_t; \
typedef TYPENAME traits<JointDerived>::U_t U_t; \
typedef TYPENAME traits<JointDerived>::D_t D_t; \
typedef TYPENAME traits<JointDerived>::UD_t UD_t; \
typedef TYPENAME traits<Joint>::Scalar Scalar; \
typedef TYPENAME traits<Joint>::JointDataDerived JointDataDerived; \
typedef TYPENAME traits<Joint>::JointModelDerived JointModelDerived; \
typedef TYPENAME traits<Joint>::Constraint_t Constraint_t; \
typedef TYPENAME traits<Joint>::Transformation_t Transformation_t; \
typedef TYPENAME traits<Joint>::Motion_t Motion_t; \
typedef TYPENAME traits<Joint>::Bias_t Bias_t; \
typedef TYPENAME traits<Joint>::U_t U_t; \
typedef TYPENAME traits<Joint>::D_t D_t; \
typedef TYPENAME traits<Joint>::UD_t UD_t; \
enum { \
Options = traits<JointDerived>::Options, \
NQ = traits<JointDerived>::NQ, \
NV = traits<JointDerived>::NV \
Options = traits<Joint>::Options, \
NQ = traits<Joint>::NQ, \
NV = traits<Joint>::NV \
}; \
typedef TYPENAME traits<JointDerived>::ConfigVector_t ConfigVector_t; \
typedef TYPENAME traits<JointDerived>::TangentVector_t TangentVector_t
typedef TYPENAME traits<Joint>::ConfigVector_t ConfigVector_t; \
typedef TYPENAME traits<Joint>::TangentVector_t TangentVector_t
#define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(TYPENAME) \
PINOCCHIO_JOINT_TYPEDEF_GENERIC(TYPENAME); \
typedef TYPENAME traits<JointDerived>::ConstraintTypeConstRef ConstraintTypeConstRef; \
typedef TYPENAME traits<JointDerived>::TansformTypeConstRef TansformTypeConstRef; \
typedef TYPENAME traits<JointDerived>::MotionTypeConstRef MotionTypeConstRef; \
typedef TYPENAME traits<JointDerived>::BiasTypeConstRef BiasTypeConstRef; \
typedef TYPENAME traits<JointDerived>::UTypeConstRef UTypeConstRef; \
typedef TYPENAME traits<JointDerived>::UTypeRef UTypeRef; \
typedef TYPENAME traits<JointDerived>::DTypeConstRef DTypeConstRef; \
typedef TYPENAME traits<JointDerived>::UDTypeConstRef UDTypeConstRef
#define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,TYPENAME) \
PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,TYPENAME); \
typedef TYPENAME traits<Joint>::ConstraintTypeConstRef ConstraintTypeConstRef; \
typedef TYPENAME traits<Joint>::TansformTypeConstRef TansformTypeConstRef; \
typedef TYPENAME traits<Joint>::MotionTypeConstRef MotionTypeConstRef; \
typedef TYPENAME traits<Joint>::BiasTypeConstRef BiasTypeConstRef; \
typedef TYPENAME traits<Joint>::UTypeConstRef UTypeConstRef; \
typedef TYPENAME traits<Joint>::UTypeRef UTypeRef; \
typedef TYPENAME traits<Joint>::DTypeConstRef DTypeConstRef; \
typedef TYPENAME traits<Joint>::UDTypeConstRef UDTypeConstRef
#ifdef __clang__
#define PINOCCHIO_JOINT_TYPEDEF PINOCCHIO_JOINT_TYPEDEF_GENERIC(PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_DATA_TYPEDEF PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_TYPEDEF(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,typename)
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) && (__GNUC_PATCHLEVEL__ == 2)
#define PINOCCHIO_JOINT_TYPEDEF PINOCCHIO_JOINT_TYPEDEF_GENERIC(PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_DATA_TYPEDEF PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_TYPEDEF(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,PINOCCHIO_EMPTY_ARG)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,typename)
#else
#define PINOCCHIO_JOINT_TYPEDEF PINOCCHIO_JOINT_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_TYPEDEF(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,typename)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(typename)
#define PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_TYPEDEF_GENERIC(Joint,typename)
#define PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(Joint) PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,typename)
#endif
......@@ -109,7 +109,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef typename traits<Derived>::JointDerived JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
Derived & derived() { return *static_cast<Derived*>(this); }
const Derived & derived() const { return *static_cast<const Derived*>(this); }
......@@ -378,7 +378,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef typename traits<Derived>::JointDerived JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
JointModelDerived & derived() { return *static_cast<Derived*>(this); }
const JointModelDerived & derived() const { return *static_cast<const Derived*>(this); }
......
......@@ -65,7 +65,7 @@ namespace pinocchio
typedef JointDataBase<JointDataCompositeTpl> Base;
typedef JointCompositeTpl<_Scalar,_Options,JointCollectionTpl> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
typedef JointCollectionTpl<Scalar,Options> JointCollection;
......@@ -146,7 +146,7 @@ namespace pinocchio
typedef JointModelBase<JointModelCompositeTpl> Base;
typedef JointCompositeTpl<_Scalar,_Options,JointCollectionTpl> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointCollectionTpl<Scalar,Options> JointCollection;
typedef JointModelTpl<Scalar,Options,JointCollectionTpl> JointModelVariant;
......
......@@ -162,7 +162,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointFreeFlyerTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -189,7 +189,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointFreeFlyerTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelFreeFlyerTpl> Base;
using Base::id;
......
......@@ -74,7 +74,7 @@ namespace pinocchio
typedef JointTpl<_Scalar,_Options,JointCollectionTpl> JointDerived;
typedef JointDataBase<JointDataTpl> Base;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
typedef JointCollectionTpl<_Scalar,_Options> JointCollection;
typedef typename JointCollection::JointDataVariant JointDataVariant;
......@@ -134,7 +134,7 @@ namespace pinocchio
typedef JointTpl<_Scalar,_Options,JointCollectionTpl> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_USE_INDEXES;
typedef JointCollectionTpl<Scalar,Options> JointCollection;
......
......@@ -388,7 +388,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPlanarTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -417,7 +417,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPlanarTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelPlanarTpl> Base;
using Base::id;
......
......@@ -378,7 +378,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPrismaticUnalignedTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Transformation_t M;
......@@ -417,7 +417,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPrismaticUnalignedTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelPrismaticUnalignedTpl> Base;
using Base::id;
......
......@@ -457,7 +457,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPrismaticTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -489,7 +489,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointPrismaticTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelPrismaticTpl> Base;
using Base::id;
......
......@@ -395,7 +395,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteUnalignedTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Transformation_t M;
......@@ -430,7 +430,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteUnalignedTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef Eigen::Matrix<Scalar,3,1,_Options> Vector3;
typedef JointModelBase<JointModelRevoluteUnalignedTpl> Base;
......
......@@ -56,7 +56,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteUnboundedTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -88,7 +88,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteUnboundedTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointRevoluteTpl<Scalar,_Options,axis> JointDerivedBase;
typedef JointModelBase<JointModelRevoluteUnboundedTpl> Base;
......
......@@ -541,7 +541,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -572,7 +572,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointRevoluteTpl<_Scalar,_Options,axis> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelRevoluteTpl> Base;
using Base::id;
......
......@@ -235,7 +235,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointSphericalZYXTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -263,7 +263,7 @@ namespace pinocchio
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointSphericalZYXTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelSphericalZYXTpl> Base;
using Base::id;
......
......@@ -345,7 +345,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointSphericalTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -373,7 +373,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointSphericalTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelSphericalTpl> Base;
using Base::id;
......
......@@ -421,7 +421,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointTranslationTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
Constraint_t S;
......@@ -448,7 +448,7 @@ namespace pinocchio
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef JointTranslationTpl<_Scalar,_Options> JointDerived;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
typedef JointModelBase<JointModelTranslationTpl> Base;
using Base::id;
......
......@@ -172,7 +172,7 @@ namespace pinocchio
typedef typename JointCollection::JointModelVariant VariantBase;
typedef typename JointCollection::JointModelVariant JointModelVariant;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
JointModelTest(const JointModelVariant & jmodel)
: VariantBase(jmodel)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment