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
0a515d49
Verified
Commit
0a515d49
authored
Apr 29, 2021
by
Justin Carpentier
Browse files
python: enhance exposition of Joints
parent
292b3011
Pipeline
#14247
failed with stage
in 81 minutes and 35 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/joint/joint-derived.hpp
View file @
0a515d49
...
...
@@ -18,7 +18,7 @@ namespace pinocchio
template
<
class
JointModelDerived
>
struct
JointModelDerivedPythonVisitor
:
public
boost
::
python
::
def_visitor
<
JointModelDerivedPythonVisitor
<
JointModelDerived
>
>
:
public
boost
::
python
::
def_visitor
<
JointModelDerivedPythonVisitor
<
JointModelDerived
>
>
{
public:
...
...
@@ -26,14 +26,21 @@ namespace pinocchio
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<>
(
bp
::
arg
(
"self"
)))
// All are add_properties cause ReadOnly
.
add_property
(
"id"
,
&
get_id
)
.
add_property
(
"idx_q"
,
&
get_idx_q
)
.
add_property
(
"idx_v"
,
&
get_idx_v
)
.
add_property
(
"nq"
,
&
get_nq
)
.
add_property
(
"nv"
,
&
get_nv
)
.
def
(
"setIndexes"
,
&
JointModelDerived
::
setIndexes
)
.
def
(
"shortname"
,
&
JointModelDerived
::
shortname
)
.
add_property
(
"id"
,
&
getId
)
.
add_property
(
"idx_q"
,
&
getIdx_q
)
.
add_property
(
"idx_v"
,
&
getIdx_v
)
.
add_property
(
"nq"
,
&
getNq
)
.
add_property
(
"nv"
,
&
getNv
)
.
def
(
"setIndexes"
,
&
JointModel
::
setIndexes
,
bp
::
args
(
"self"
,
"id"
,
"idx_q"
,
"idx_v"
))
.
def
(
"hasSameIndexes"
,
&
JointModel
::
hasSameIndexes
,
bp
::
args
(
"self"
,
"other"
),
"Check if this has same indexes than other."
)
.
def
(
"shortname"
,
&
JointModel
::
shortname
,
bp
::
arg
(
"self"
))
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
...
...
@@ -58,7 +65,7 @@ namespace pinocchio
template
<
class
JointDataDerived
>
struct
JointDataDerivedPythonVisitor
:
public
boost
::
python
::
def_visitor
<
JointDataDerivedPythonVisitor
<
JointDataDerived
>
>
:
public
boost
::
python
::
def_visitor
<
JointDataDerivedPythonVisitor
<
JointDataDerived
>
>
{
public:
...
...
bindings/python/multibody/joint/joint.hpp
View file @
0a515d49
...
...
@@ -31,8 +31,14 @@ namespace pinocchio
.
add_property
(
"idx_v"
,
&
getIdx_v
)
.
add_property
(
"nq"
,
&
getNq
)
.
add_property
(
"nv"
,
&
getNv
)
.
def
(
"setIndexes"
,
&
JointModel
::
setIndexes
)
.
def
(
"shortname"
,
&
JointModel
::
shortname
)
.
def
(
"setIndexes"
,
&
JointModel
::
setIndexes
,
bp
::
args
(
"self"
,
"id"
,
"idx_q"
,
"idx_v"
))
.
def
(
"hasSameIndexes"
,
&
JointModel
::
hasSameIndexes
,
bp
::
args
(
"self"
,
"other"
),
"Check if this has same indexes than other."
)
.
def
(
"shortname"
,
&
JointModel
::
shortname
,
bp
::
arg
(
"self"
))
.
def
(
bp
::
self
==
bp
::
self
)
.
def
(
bp
::
self
!=
bp
::
self
)
...
...
bindings/python/multibody/joint/joints-variant.hpp
View file @
0a515d49
...
...
@@ -57,7 +57,7 @@ namespace pinocchio
expose_joint_model
<
T
>
(
bp
::
class_
<
T
>
(
T
::
classname
().
c_str
(),
T
::
classname
().
c_str
(),
bp
::
init
<>
()
)
bp
::
no_
init
)
.
def
(
JointModelDerivedPythonVisitor
<
T
>
())
.
def
(
PrintableVisitor
<
T
>
())
);
...
...
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