5#ifndef __pinocchio_python_multibody_joint_joint_model_hpp__
6#define __pinocchio_python_multibody_joint_joint_model_hpp__
8#include "pinocchio/multibody/joint/joint-generic.hpp"
9#include "pinocchio/bindings/python/multibody/joint/joint-derived.hpp"
10#include "pinocchio/bindings/python/utils/printable.hpp"
16 namespace bp = boost::python;
18 template<
typename Jo
intModel>
19 struct ExtractJointModelVariantTypeVisitor
21 typedef typename JointModel::JointCollection JointCollection;
22 typedef bp::object result_type;
24 template<
typename Jo
intModelDerived>
25 result_type operator()(
const JointModelBase<JointModelDerived> & jmodel)
const
27 bp::object obj(boost::ref(jmodel.derived()));
31 static result_type extract(
const JointModel & jmodel)
33 return boost::apply_visitor(ExtractJointModelVariantTypeVisitor(), jmodel);
37 template<
typename Jo
intModel>
38 struct JointModelPythonVisitor
43 bp::class_<JointModel>(
"JointModel",
"Generic Joint Model", bp::no_init)
44 .def(bp::init<>(bp::arg(
"self"),
"Default constructor"))
45 .def(bp::init<const JointModel &>(bp::args(
"self",
"other"),
"Copy constructor"))
46 .def(JointModelBasePythonVisitor<JointModel>())
47 .def(PrintableVisitor<JointModel>())
49 "extract", ExtractJointModelVariantTypeVisitor<JointModel>::extract, bp::arg(
"self"),
50 "Returns a reference of the internal joint managed by the JointModel",
51 bp::with_custodian_and_ward_postcall<0, 1>());
Main pinocchio namespace.