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
34e63e97
Verified
Commit
34e63e97
authored
Apr 27, 2021
by
Justin Carpentier
Browse files
python: expose operator{==,!=} for joints
parent
1d2d3130
Changes
3
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/joint/joint-derived.hpp
View file @
34e63e97
//
// Copyright (c) 2015-202
0
CNRS INRIA
// Copyright (c) 2015-202
1
CNRS INRIA
//
#ifndef __pinocchio_python_joint_variants_hpp__
...
...
@@ -34,6 +34,9 @@ namespace pinocchio
.
add_property
(
"nv"
,
&
get_nv
)
.
def
(
"setIndexes"
,
&
JointModelDerived
::
setIndexes
)
.
def
(
"shortname"
,
&
JointModelDerived
::
shortname
)
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
;
}
...
...
@@ -72,6 +75,9 @@ namespace pinocchio
.
add_property
(
"Dinv"
,
&
get_Dinv
)
.
add_property
(
"UDinv"
,
&
get_UDinv
)
.
def
(
"shortname"
,
&
JointDataDerived
::
shortname
)
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
;
}
...
...
bindings/python/multibody/joint/joint.hpp
View file @
34e63e97
...
...
@@ -33,6 +33,9 @@ namespace pinocchio
.
add_property
(
"nv"
,
&
getNv
)
.
def
(
"setIndexes"
,
&
JointModel
::
setIndexes
)
.
def
(
"shortname"
,
&
JointModel
::
shortname
)
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
;
}
...
...
bindings/python/multibody/joint/joints-models.hpp
View file @
34e63e97
...
...
@@ -114,35 +114,39 @@ namespace pinocchio
}
template
<
>
inline
bp
::
class_
<
JointModelComposite
>&
expose_joint_model
<
JointModelComposite
>
(
bp
::
class_
<
JointModelComposite
>
&
cl
)
bp
::
class_
<
JointModelComposite
>
&
expose_joint_model
<
JointModelComposite
>
(
bp
::
class_
<
JointModelComposite
>
&
cl
)
{
return
cl
.
def
(
bp
::
init
<
const
size_t
>
(
bp
::
args
(
"self"
,
"size"
),
"Init JointModelComposite with a defined size"
))
.
def
(
"__init__"
,
bp
::
make_constructor
(
init_proxy1
,
bp
::
default_call_policies
(),
bp
::
args
(
"joint_model"
)
),
"Init JointModelComposite from a joint"
)
.
def
(
"__init__"
,
bp
::
make_constructor
(
init_proxy2
,
bp
::
default_call_policies
(),
bp
::
args
(
"joint_model"
,
"joint_placement"
)
),
"Init JointModelComposite from a joint and a placement"
)
.
add_property
(
"joints"
,
&
JointModelComposite
::
joints
)
.
add_property
(
"jointPlacements"
,
&
JointModelComposite
::
jointPlacements
)
.
add_property
(
"njoints"
,
&
JointModelComposite
::
njoints
)
.
def
(
"addJoint"
,
&
addJoint_proxy
,
addJoint_proxy_overloads
(
bp
::
args
(
"self"
,
"joint_model"
,
"joint_placement"
),
"Add a joint to the vector of joints."
)[
bp
::
return_internal_reference
<>
()]
)
;
.
def
(
bp
::
init
<
const
size_t
>
(
bp
::
args
(
"self"
,
"size"
),
"Init JointModelComposite with a defined size"
))
.
def
(
"__init__"
,
bp
::
make_constructor
(
init_proxy1
,
bp
::
default_call_policies
(),
bp
::
args
(
"joint_model"
)
),
"Init JointModelComposite from a joint"
)
.
def
(
"__init__"
,
bp
::
make_constructor
(
init_proxy2
,
bp
::
default_call_policies
(),
bp
::
args
(
"joint_model"
,
"joint_placement"
)
),
"Init JointModelComposite from a joint and a placement"
)
.
add_property
(
"joints"
,
&
JointModelComposite
::
joints
)
.
add_property
(
"jointPlacements"
,
&
JointModelComposite
::
jointPlacements
)
.
add_property
(
"njoints"
,
&
JointModelComposite
::
njoints
)
.
def
(
"addJoint"
,
&
addJoint_proxy
,
addJoint_proxy_overloads
(
bp
::
args
(
"self"
,
"joint_model"
,
"joint_placement"
),
"Add a joint to the vector of joints."
)[
bp
::
return_internal_reference
<>
()]
)
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
;
}
}
// namespace python
}
// namespace pinocchio
...
...
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