Verified Commit 809e4490 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

joints: add ref accessor to Constraint

parent 66c8370d
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,TYPENAME) \ #define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,TYPENAME) \
PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint,TYPENAME); \ PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint,TYPENAME); \
typedef TYPENAME traits<Joint>::ConstraintTypeConstRef ConstraintTypeConstRef; \ typedef TYPENAME traits<Joint>::ConstraintTypeConstRef ConstraintTypeConstRef; \
typedef TYPENAME traits<Joint>::ConstraintTypeRef ConstraintTypeRef; \
typedef TYPENAME traits<Joint>::TansformTypeConstRef TansformTypeConstRef; \ typedef TYPENAME traits<Joint>::TansformTypeConstRef TansformTypeConstRef; \
typedef TYPENAME traits<Joint>::TansformTypeRef TansformTypeRef; \ typedef TYPENAME traits<Joint>::TansformTypeRef TansformTypeRef; \
typedef TYPENAME traits<Joint>::MotionTypeConstRef MotionTypeConstRef; \ typedef TYPENAME traits<Joint>::MotionTypeConstRef MotionTypeConstRef; \
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
#define PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR \ #define PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR \
ConstraintTypeConstRef S_accessor() const { return S; } \ ConstraintTypeConstRef S_accessor() const { return S; } \
ConstraintTypeRef S_accessor() { return S; } \
TansformTypeConstRef M_accessor() const { return M; } \ TansformTypeConstRef M_accessor() const { return M; } \
TansformTypeRef M_accessor() { return M; } \ TansformTypeRef M_accessor() { return M; } \
MotionTypeConstRef v_accessor() const { return v; } \ MotionTypeConstRef v_accessor() const { return v; } \
...@@ -55,6 +57,7 @@ ...@@ -55,6 +57,7 @@
#define PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE \ #define PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE \
typedef const Constraint_t & ConstraintTypeConstRef; \ typedef const Constraint_t & ConstraintTypeConstRef; \
typedef Constraint_t & ConstraintTypeRef; \
typedef const Transformation_t & TansformTypeConstRef; \ typedef const Transformation_t & TansformTypeConstRef; \
typedef Transformation_t & TansformTypeRef; \ typedef Transformation_t & TansformTypeRef; \
typedef const Motion_t & MotionTypeConstRef; \ typedef const Motion_t & MotionTypeConstRef; \
...@@ -81,6 +84,7 @@ namespace pinocchio ...@@ -81,6 +84,7 @@ namespace pinocchio
const Derived & derived() const { return *static_cast<const Derived*>(this); } const Derived & derived() const { return *static_cast<const Derived*>(this); }
ConstraintTypeConstRef S() const { return derived().S_accessor(); } ConstraintTypeConstRef S() const { return derived().S_accessor(); }
ConstraintTypeRef S() { return derived().S_accessor(); }
TansformTypeConstRef M() const { return derived().M_accessor(); } TansformTypeConstRef M() const { return derived().M_accessor(); }
TansformTypeRef M() { return derived().M_accessor(); } TansformTypeRef M() { return derived().M_accessor(); }
MotionTypeConstRef v() const { return derived().v_accessor(); } MotionTypeConstRef v() const { return derived().v_accessor(); }
......
// //
// Copyright (c) 2016,2018 CNRS // Copyright (c) 2016-2019 CNRS INRIA
// //
#ifndef __pinocchio_joint_generic_hpp__ #ifndef __pinocchio_joint_generic_hpp__
...@@ -44,6 +44,7 @@ namespace pinocchio ...@@ -44,6 +44,7 @@ namespace pinocchio
typedef Eigen::Matrix<Scalar,6,Eigen::Dynamic,Options> UD_t; typedef Eigen::Matrix<Scalar,6,Eigen::Dynamic,Options> UD_t;
typedef Constraint_t ConstraintTypeConstRef; typedef Constraint_t ConstraintTypeConstRef;
typedef Constraint_t ConstraintTypeRef;
typedef Transformation_t TansformTypeConstRef; typedef Transformation_t TansformTypeConstRef;
typedef Transformation_t TansformTypeRef; typedef Transformation_t TansformTypeRef;
typedef Motion_t MotionTypeConstRef; typedef Motion_t MotionTypeConstRef;
...@@ -111,9 +112,7 @@ namespace pinocchio ...@@ -111,9 +112,7 @@ namespace pinocchio
/// Define all the standard accessors /// Define all the standard accessors
Constraint_t S_accessor() const { return S(); } Constraint_t S_accessor() const { return S(); }
Transformation_t M_accessor() const { return M(); } Transformation_t M_accessor() const { return M(); }
Transformation_t M_accessor() { return M(); }
Motion_t v_accessor() const { return v(); } Motion_t v_accessor() const { return v(); }
Motion_t v_accessor() { return v(); }
Bias_t c_accessor() const { return c(); } Bias_t c_accessor() const { return c(); }
Bias_t c_accessor() { return c(); } Bias_t c_accessor() { return c(); }
U_t U_accessor() const { return U(); } U_t U_accessor() const { return U(); }
......
...@@ -153,7 +153,10 @@ namespace pinocchio ...@@ -153,7 +153,10 @@ namespace pinocchio
} }
inline const Scalar & scaling() const { return m_scaling_factor; } inline const Scalar & scaling() const { return m_scaling_factor; }
inline Scalar & scaling() { return m_scaling_factor; }
inline const Constraint & constraint() const { return m_constraint; } inline const Constraint & constraint() const { return m_constraint; }
inline Constraint & constraint() { return m_constraint; }
bool isEqual(const ScaledConstraint & other) const bool isEqual(const ScaledConstraint & other) const
{ {
...@@ -306,6 +309,7 @@ namespace pinocchio ...@@ -306,6 +309,7 @@ namespace pinocchio
// Accessors // Accessors
ConstraintTypeConstRef S_accessor() const { return S; } ConstraintTypeConstRef S_accessor() const { return S; }
ConstraintTypeRef S_accessor() { return S; }
TansformTypeConstRef M_accessor() const { return jdata_ref.M; } TansformTypeConstRef M_accessor() const { return jdata_ref.M; }
TansformTypeRef M_accessor() { return jdata_ref.M; } TansformTypeRef M_accessor() { return jdata_ref.M; }
MotionTypeConstRef v_accessor() const { return jdata_ref.v; } MotionTypeConstRef v_accessor() const { return jdata_ref.v; }
......
Markdown is supported
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