Skip to content
GitLab
Menu
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
601790d0
Verified
Commit
601790d0
authored
Apr 15, 2021
by
Justin Carpentier
Browse files
python: remove JointModelVariant intermediates
parent
758c694a
Changes
2
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/joint/joint.hpp
View file @
601790d0
//
// Copyright (c) 2015-202
0
CNRS INRIA
// Copyright (c) 2015-202
1
CNRS INRIA
//
#ifndef __pinocchio_python_joint_hpp__
#define __pinocchio_python_joint_hpp__
#ifndef __pinocchio_python_
multibody_joint_
joint_hpp__
#define __pinocchio_python_
multibody_joint_
joint_hpp__
#include
<boost/python.hpp>
...
...
@@ -17,22 +17,20 @@ namespace pinocchio
namespace
bp
=
boost
::
python
;
struct
JointModelPythonVisitor
:
public
boost
::
python
::
def_visitor
<
JointModelPythonVisitor
>
:
public
boost
::
python
::
def_visitor
<
JointModelPythonVisitor
>
{
public:
template
<
class
PyClass
>
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<>
())
.
def
(
bp
::
init
<>
(
bp
::
arg
(
"self"
)
))
// All are add_properties cause ReadOnly
.
add_property
(
"id"
,
&
JointModelPythonVisitor
::
getId
)
.
add_property
(
"idx_q"
,
&
JointModelPythonVisitor
::
getIdx_q
)
.
add_property
(
"idx_v"
,
&
JointModelPythonVisitor
::
getIdx_v
)
.
add_property
(
"nq"
,
&
JointModelPythonVisitor
::
getNq
)
.
add_property
(
"nv"
,
&
JointModelPythonVisitor
::
getNv
)
.
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
)
.
def
(
"shortname"
,
&
JointModel
::
shortname
)
;
...
...
@@ -49,7 +47,7 @@ namespace pinocchio
bp
::
class_
<
JointModel
>
(
"JointModel"
,
"Generic Joint Model"
,
bp
::
no_init
)
.
def
(
bp
::
init
<
pinocchio
::
JointModelVariant
>
(
))
.
def
(
bp
::
init
<
JointModel
>
(
bp
::
args
(
"self"
,
"other"
)
))
.
def
(
JointModelPythonVisitor
())
.
def
(
PrintableVisitor
<
JointModel
>
())
;
...
...
@@ -59,4 +57,4 @@ namespace pinocchio
}}
// namespace pinocchio::python
#endif // ifndef __pinocchio_python_joint_hpp__
#endif // ifndef __pinocchio_python_
multibody_joint_
joint_hpp__
bindings/python/multibody/joint/joints-variant.hpp
View file @
601790d0
//
// Copyright (c) 2015-202
0
CNRS INRIA
// Copyright (c) 2015-202
1
CNRS INRIA
//
#ifndef __pinocchio_python_joints_variant_hpp__
...
...
@@ -45,7 +45,7 @@ namespace pinocchio
.
def
(
JointDataDerivedPythonVisitor
<
T
>
())
.
def
(
PrintableVisitor
<
T
>
())
);
bp
::
implicitly_convertible
<
T
,
pinocchio
::
JointData
Variant
>
();
bp
::
implicitly_convertible
<
T
,
pinocchio
::
JointData
>
();
}
};
...
...
@@ -61,7 +61,7 @@ namespace pinocchio
.
def
(
JointModelDerivedPythonVisitor
<
T
>
())
.
def
(
PrintableVisitor
<
T
>
())
);
bp
::
implicitly_convertible
<
T
,
pinocchio
::
JointModel
Variant
>
();
bp
::
implicitly_convertible
<
T
,
pinocchio
::
JointModel
>
();
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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