Commit 9c6010b9 authored by Florian Valenza's avatar Florian Valenza
Browse files

[Major] Specializing macro SE3_JOINT_TYPEDEF for expansion in templated or non templated class

parent a2c81f46
......@@ -46,20 +46,23 @@ namespace se3
* Constraint::se3Action
*/
#define SE3_JOINT_TYPEDEF \
#define SE3_JOINT_TYPEDEF_ARG(prefix) \
typedef int Index; \
typedef typename traits<Joint>::JointData JointData; \
typedef typename traits<Joint>::JointModel JointModel; \
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>::F_t F_t; \
typedef prefix traits<Joint>::JointData JointData; \
typedef prefix traits<Joint>::JointModel JointModel; \
typedef prefix traits<Joint>::Constraint_t Constraint_t; \
typedef prefix traits<Joint>::Transformation_t Transformation_t; \
typedef prefix traits<Joint>::Motion_t Motion_t; \
typedef prefix traits<Joint>::Bias_t Bias_t; \
typedef prefix traits<Joint>::F_t F_t; \
enum { \
NQ = traits<Joint>::NQ, \
NV = traits<Joint>::NV \
}
#define SE3_JOINT_TYPEDEF SE3_JOINT_TYPEDEF_ARG()
#define SE3_JOINT_TYPEDEF_TEMPLATE SE3_JOINT_TYPEDEF_ARG(typename)
#define SE3_JOINT_USE_INDEXES \
typedef JointModelBase<JointModel> Base; \
using Base::idx_q; \
......@@ -69,7 +72,7 @@ namespace se3
struct JointDataBase
{
typedef typename traits<_JointData>::Joint Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
JointData& derived() { return *static_cast<JointData*>(this); }
const JointData& derived() const { return *static_cast<const JointData*>(this); }
......@@ -85,7 +88,7 @@ namespace se3
struct JointModelBase
{
typedef typename traits<_JointModel>::Joint Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
JointModel& derived() { return *static_cast<JointModel*>(this); }
const JointModel& derived() const { return *static_cast<const JointModel*>(this); }
......
......@@ -256,7 +256,7 @@ namespace se3
struct JointDataPrismatic : public JointDataBase< JointDataPrismatic<axis> >
{ //TODO : check.
typedef JointPrismatic<axis> Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
Constraint_t S;
Transformation_t M;
......@@ -275,7 +275,7 @@ namespace se3
struct JointModelPrismatic : public JointModelBase< JointModelPrismatic<axis> >
{ //TODO
typedef JointPrismatic<axis> Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
using JointModelBase<JointModelPrismatic>::idx_q;
using JointModelBase<JointModelPrismatic>::idx_v;
......
......@@ -282,7 +282,7 @@ namespace se3
struct JointDataRevolute : public JointDataBase< JointDataRevolute<axis> >
{
typedef JointRevolute<axis> Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
Constraint_t S;
Transformation_t M;
......@@ -301,7 +301,7 @@ namespace se3
struct JointModelRevolute : public JointModelBase< JointModelRevolute<axis> >
{
typedef JointRevolute<axis> Joint;
SE3_JOINT_TYPEDEF;
SE3_JOINT_TYPEDEF_TEMPLATE;
using JointModelBase<JointModelRevolute>::idx_q;
using JointModelBase<JointModelRevolute>::idx_v;
......
......@@ -105,7 +105,7 @@ namespace se3
Eigen::Matrix <double, 6, 3> M;
// M.block <3,3> (Inertia::LINEAR, 0) = - Y.mass () * skew(Y.lever ());
M.block <3,3> (Inertia::LINEAR, 0) = alphaSkew ( -Y.mass (), Y.lever ());
M.block <3,3> (Inertia::ANGULAR, 0) = (Inertia::Matrix3)(Y.inertia () - typename Symmetric3::AlphaSkewSquare(Y.mass (), Y.lever ()));
M.block <3,3> (Inertia::ANGULAR, 0) = (Inertia::Matrix3)(Y.inertia () - Symmetric3::AlphaSkewSquare(Y.mass (), Y.lever ()));
return M;
}
......
......@@ -22,7 +22,7 @@ namespace se3
{
struct AlgorithmsPythonVisitor
{
typedef typename eigenpy::UnalignedEquivalent<Eigen::VectorXd>::type VectorXd_fx;
typedef eigenpy::UnalignedEquivalent<Eigen::VectorXd>::type VectorXd_fx;
static Eigen::VectorXd rnea_proxy( const ModelHandler& model,
DataHandler & data,
......
......@@ -24,7 +24,7 @@ namespace se3
{
public:
typedef Model::Index Index;
typedef typename eigenpy::UnalignedEquivalent<Motion>::type Motion_fx;
typedef eigenpy::UnalignedEquivalent<Motion>::type Motion_fx;
public:
......
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