Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
809e4490
Verified
Commit
809e4490
authored
Dec 17, 2019
by
Justin Carpentier
Browse files
joints: add ref accessor to Constraint
parent
66c8370d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/multibody/joint/joint-data-base.hpp
View file @
809e4490
...
...
@@ -12,6 +12,7 @@
#define PINOCCHIO_JOINT_DATA_TYPEDEF_GENERIC(Joint,TYPENAME) \
PINOCCHIO_JOINT_MODEL_TYPEDEF_GENERIC(Joint,TYPENAME); \
typedef TYPENAME traits<Joint>::ConstraintTypeConstRef ConstraintTypeConstRef; \
typedef TYPENAME traits<Joint>::ConstraintTypeRef ConstraintTypeRef; \
typedef TYPENAME traits<Joint>::TansformTypeConstRef TansformTypeConstRef; \
typedef TYPENAME traits<Joint>::TansformTypeRef TansformTypeRef; \
typedef TYPENAME traits<Joint>::MotionTypeConstRef MotionTypeConstRef; \
...
...
@@ -42,6 +43,7 @@
#define PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR \
ConstraintTypeConstRef S_accessor() const { return S; } \
ConstraintTypeRef S_accessor() { return S; } \
TansformTypeConstRef M_accessor() const { return M; } \
TansformTypeRef M_accessor() { return M; } \
MotionTypeConstRef v_accessor() const { return v; } \
...
...
@@ -55,6 +57,7 @@
#define PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE \
typedef const Constraint_t & ConstraintTypeConstRef; \
typedef Constraint_t & ConstraintTypeRef; \
typedef const Transformation_t & TansformTypeConstRef; \
typedef Transformation_t & TansformTypeRef; \
typedef const Motion_t & MotionTypeConstRef; \
...
...
@@ -81,6 +84,7 @@ namespace pinocchio
const
Derived
&
derived
()
const
{
return
*
static_cast
<
const
Derived
*>
(
this
);
}
ConstraintTypeConstRef
S
()
const
{
return
derived
().
S_accessor
();
}
ConstraintTypeRef
S
()
{
return
derived
().
S_accessor
();
}
TansformTypeConstRef
M
()
const
{
return
derived
().
M_accessor
();
}
TansformTypeRef
M
()
{
return
derived
().
M_accessor
();
}
MotionTypeConstRef
v
()
const
{
return
derived
().
v_accessor
();
}
...
...
src/multibody/joint/joint-generic.hpp
View file @
809e4490
//
// Copyright (c) 2016
,
201
8
CNRS
// Copyright (c) 2016
-
201
9
CNRS
INRIA
//
#ifndef __pinocchio_joint_generic_hpp__
...
...
@@ -44,6 +44,7 @@ namespace pinocchio
typedef
Eigen
::
Matrix
<
Scalar
,
6
,
Eigen
::
Dynamic
,
Options
>
UD_t
;
typedef
Constraint_t
ConstraintTypeConstRef
;
typedef
Constraint_t
ConstraintTypeRef
;
typedef
Transformation_t
TansformTypeConstRef
;
typedef
Transformation_t
TansformTypeRef
;
typedef
Motion_t
MotionTypeConstRef
;
...
...
@@ -111,9 +112,7 @@ namespace pinocchio
/// Define all the standard accessors
Constraint_t
S_accessor
()
const
{
return
S
();
}
Transformation_t
M_accessor
()
const
{
return
M
();
}
Transformation_t
M_accessor
()
{
return
M
();
}
Motion_t
v_accessor
()
const
{
return
v
();
}
Motion_t
v_accessor
()
{
return
v
();
}
Bias_t
c_accessor
()
const
{
return
c
();
}
Bias_t
c_accessor
()
{
return
c
();
}
U_t
U_accessor
()
const
{
return
U
();
}
...
...
src/multibody/joint/joint-mimic.hpp
View file @
809e4490
...
...
@@ -153,7 +153,10 @@ namespace pinocchio
}
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
Constraint
&
constraint
()
{
return
m_constraint
;
}
bool
isEqual
(
const
ScaledConstraint
&
other
)
const
{
...
...
@@ -306,6 +309,7 @@ namespace pinocchio
// Accessors
ConstraintTypeConstRef
S_accessor
()
const
{
return
S
;
}
ConstraintTypeRef
S_accessor
()
{
return
S
;
}
TansformTypeConstRef
M_accessor
()
const
{
return
jdata_ref
.
M
;
}
TansformTypeRef
M_accessor
()
{
return
jdata_ref
.
M
;
}
MotionTypeConstRef
v_accessor
()
const
{
return
jdata_ref
.
v
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment