Verified Commit 601790d0 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

python: remove JointModelVariant intermediates

parent 758c694a
//
// Copyright (c) 2015-2020 CNRS INRIA
// Copyright (c) 2015-2021 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>
......@@ -20,19 +20,17 @@ namespace pinocchio
: 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__
//
// Copyright (c) 2015-2020 CNRS INRIA
// Copyright (c) 2015-2021 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::JointDataVariant>();
bp::implicitly_convertible<T,pinocchio::JointData>();
}
};
......@@ -61,7 +61,7 @@ namespace pinocchio
.def(JointModelDerivedPythonVisitor<T>())
.def(PrintableVisitor<T>())
);
bp::implicitly_convertible<T,pinocchio::JointModelVariant>();
bp::implicitly_convertible<T,pinocchio::JointModel>();
}
};
......
Supports Markdown
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