5 #ifndef __pinocchio_python_joint_variants_hpp__ 6 #define __pinocchio_python_joint_variants_hpp__ 8 #include <boost/python.hpp> 11 #include "pinocchio/multibody/joint/joint-collection.hpp" 19 template<
class Jo
intModelDerived>
21 :
public boost::python::def_visitor< JointModelDerivedPythonVisitor<JointModelDerived> >
25 template<
class PyClass>
29 .def(bp::init<>(bp::arg(
"self")))
31 .add_property(
"id",&
get_id)
34 .add_property(
"nq",&
get_nq)
35 .add_property(
"nv",&
get_nv)
36 .add_property(
"hasConfigurationLimit",
38 "Return vector of boolean if joint has configuration limits.")
39 .add_property(
"hasConfigurationLimitInTangent",
41 "Return vector of boolean if joint has configuration limits in tangent space.")
44 bp::args(
"self",
"id",
"idx_q",
"idx_v"))
45 .def(
"hasSameIndexes",
46 &JointModelDerived::template hasSameIndexes<JointModelDerived>,
47 bp::args(
"self",
"other"),
48 "Check if this has same indexes than other.")
52 "Returns string indicating the joint type (class name):" 53 "\n\t- JointModelR[*]: Revolute Joint, with rotation axis [*] ∈ [X,Y,Z]" 54 "\n\t- JointModelRevoluteUnaligned: Revolute Joint, with rotation axis not aligned with X, Y, nor Z" 55 "\n\t- JointModelRUB[*]: Unbounded revolute Joint (without position limits), with rotation axis [*] ∈ [X,Y,Z]" 56 "\n\t- JointModelRevoluteUnboundedUnaligned: Unbounded revolute Joint, with rotation axis not aligned with X, Y, nor Z" 57 "\n\t- JointModelP[*]: Prismatic Joint, with rotation axis [*] ∈ [X,Y,Z]" 58 "\n\t- JointModelPlanar: Planar joint" 59 "\n\t- JointModelPrismaticUnaligned: Prismatic joint, with translation axis not aligned with X, Y, nor Z" 60 "\n\t- JointModelSphericalZYX: Spherical joint (3D rotation)" 61 "\n\t- JointModelTranslation: Translation joint (3D translation)" 62 "\n\t- JointModelFreeFlyer: Joint enabling 3D rotation and translations." 65 .def(bp::self == bp::self)
66 .def(bp::self != bp::self)
72 static int get_idx_q(
const JointModelDerived &
self)
73 {
return self.idx_q(); }
74 static int get_idx_v(
const JointModelDerived &
self)
75 {
return self.idx_v(); }
76 static int get_nq(
const JointModelDerived &
self)
78 static int get_nv(
const JointModelDerived &
self)
83 template<
class Jo
intDataDerived>
85 :
public boost::python::def_visitor< JointDataDerivedPythonVisitor<JointDataDerived> >
89 template<
class PyClass>
94 .add_property(
"S",&get_S)
95 .add_property(
"M",&get_M)
96 .add_property(
"v",&get_v)
97 .add_property(
"c",&get_c)
98 .add_property(
"U",&get_U)
99 .add_property(
"Dinv",&get_Dinv)
100 .add_property(
"UDinv",&get_UDinv)
103 .def(bp::self == bp::self)
104 .def(bp::self != bp::self)
108 static typename JointDataDerived::Constraint_t
get_S(
const JointDataDerived &
self)
109 {
return self.S_accessor(); }
110 static typename JointDataDerived::Transformation_t
get_M(
const JointDataDerived &
self)
111 {
return self.M_accessor(); }
112 static typename JointDataDerived::Motion_t
get_v(
const JointDataDerived &
self)
113 {
return self.v_accessor(); }
114 static typename JointDataDerived::Bias_t
get_c(
const JointDataDerived &
self)
115 {
return self.c_accessor(); }
116 static typename JointDataDerived::U_t
get_U(
const JointDataDerived &
self)
117 {
return self.U_accessor(); }
118 static typename JointDataDerived::D_t
get_Dinv(
const JointDataDerived &
self)
119 {
return self.Dinv_accessor(); }
120 static typename JointDataDerived::UD_t
get_UDinv(
const JointDataDerived &
self)
121 {
return self.UDinv_accessor(); }
130 #endif // ifndef __pinocchio_python_joint_variants_hpp__ static JointDataDerived::D_t get_Dinv(const JointDataDerived &self)
void visit(PyClass &cl) const
static JointDataDerived::Transformation_t get_M(const JointDataDerived &self)
static JointDataDerived::Motion_t get_v(const JointDataDerived &self)
const std::vector< bool > hasConfigurationLimitInTangent(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointConfigurationLimitInTangentVisitor to get the configurations limit...
static JointDataDerived::Constraint_t get_S(const JointDataDerived &self)
static int get_idx_v(const JointModelDerived &self)
static JointDataDerived::U_t get_U(const JointDataDerived &self)
std::string shortname(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointShortnameVisitor to get the shortname of the derived joint model...
static JointDataDerived::UD_t get_UDinv(const JointDataDerived &self)
void visit(PyClass &cl) const
static int get_nq(const JointModelDerived &self)
Main pinocchio namespace.
const std::vector< bool > hasConfigurationLimit(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointConfigurationLimitVisitor to get the configurations limits...
static JointIndex get_id(const JointModelDerived &self)
void setIndexes(JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointIndex id, int q, int v)
Visit a JointModelTpl through JointSetIndexesVisitor to set the indexes of the joint in the kinematic...
static int get_idx_q(const JointModelDerived &self)
static JointDataDerived::Bias_t get_c(const JointDataDerived &self)
static int get_nv(const JointModelDerived &self)