5#ifndef __pinocchio_python_multibody_joint_joint_hpp__
6#define __pinocchio_python_multibody_joint_joint_hpp__
8#include <boost/python.hpp>
10#include "pinocchio/multibody/joint/joint-generic.hpp"
11#include "pinocchio/bindings/python/utils/printable.hpp"
17 namespace bp = boost::python;
19 struct JointModelPythonVisitor :
public boost::python::def_visitor<JointModelPythonVisitor>
22 template<
class PyClass>
23 void visit(PyClass & cl)
const
25 cl.def(bp::init<>(bp::arg(
"self")))
27 .add_property(
"id", &getId)
28 .add_property(
"idx_q", &getIdx_q)
29 .add_property(
"idx_v", &getIdx_v)
30 .add_property(
"idx_vExtended", &getIdx_vExtended)
31 .add_property(
"nq", &getNq)
32 .add_property(
"nv", &getNv)
33 .add_property(
"nvExtended", &getNvExtended)
35 "hasConfigurationLimit", &JointModel::hasConfigurationLimit,
36 "Return vector of boolean if joint has configuration limits.")
38 "hasConfigurationLimitInTangent", &JointModel::hasConfigurationLimitInTangent,
39 "Return vector of boolean if joint has configuration limits in tangent space.")
40 .def(
"setIndexes", setIndexes0, bp::args(
"self",
"id",
"idx_q",
"idx_v"))
41 .def(
"setIndexes", setIndexes1, bp::args(
"self",
"id",
"idx_q",
"idx_v",
"idx_vExtended"))
43 "hasSameIndexes", &JointModel::hasSameIndexes<JointModel>, bp::args(
"self",
"other"),
44 "Check if this has same indexes than other.")
46 "shortname", &JointModel::shortname, bp::arg(
"self"),
47 "Returns string indicating the joint type (class name):"
48 "\n\t- JointModelR[*]: Revolute Joint, with rotation axis [*] ∈ [X,Y,Z]"
49 "\n\t- JointModelRevoluteUnaligned: Revolute Joint, with rotation axis not aligned "
51 "\n\t- JointModelRUB[*]: Unbounded revolute Joint (without position limits), with "
52 "rotation axis [*] ∈ [X,Y,Z]"
53 "\n\t- JointModelRevoluteUnboundedUnaligned: Unbounded revolute Joint, with "
54 "rotation axis not aligned with X, Y, nor Z"
55 "\n\t- JointModelP[*]: Prismatic Joint, with rotation axis [*] ∈ [X,Y,Z]"
56 "\n\t- JointModelPlanar: Planar joint"
57 "\n\t- JointModelPrismaticUnaligned: Prismatic joint, with translation axis not "
58 "aligned with X, Y, nor Z"
59 "\n\t- JointModelSphericalZYX: Spherical joint (3D rotation)"
60 "\n\t- JointModelTranslation: Translation joint (3D translation)"
61 "\n\t- JointModelFreeFlyer: Joint enabling 3D rotation and translations.")
63 .def(bp::self == bp::self)
64 .def(bp::self != bp::self);
67 static JointIndex getId(
const JointModel & self)
71 static int getIdx_q(
const JointModel & self)
75 static int getIdx_v(
const JointModel & self)
79 static int getIdx_vExtended(
const JointModel & self)
81 return self.idx_vExtended();
83 static int getNq(
const JointModel & self)
87 static int getNv(
const JointModel & self)
91 static int getNvExtended(
const JointModel & self)
93 return self.nvExtended();
97 setIndexes0(JointModelDerived & self,
const int &
id,
const int &
idx_q,
const int &
idx_v)
102 static void setIndexes1(
103 JointModelDerived & self,
114 bp::class_<JointModel>(
"JointModel",
"Generic Joint Model", bp::no_init)
115 .def(bp::init<JointModel>(bp::args(
"self",
"other")))
116 .def(JointModelPythonVisitor())
117 .def(PrintableVisitor<JointModel>());
Main pinocchio namespace.
int idx_v(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxVVisitor to get the index in the model tangent space correspond...
int idx_q(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxQVisitor to get the index in the full model configuration space...
int idx_vExtended(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdvExtendedVisitor to get the index in the model extended tangent ...