21 :
public boost::python::def_visitor<JointModelBasePythonVisitor<JointModelDerived>>
24 typedef typename JointModelDerived::JointDataDerived JointDataDerived;
26 template<
class PyClass>
27 void visit(PyClass & cl)
const 29 cl.def(bp::init<>(bp::arg(
"self")))
31 .add_property(
"id", &get_id)
32 .add_property(
"idx_q", &get_idx_q)
33 .add_property(
"idx_v", &get_idx_v)
34 .add_property(
"idx_vExtended", &get_idx_vExtended)
35 .add_property(
"nq", &get_nq)
36 .add_property(
"nv", &get_nv)
37 .add_property(
"nvExtended", &get_nvExtended)
39 "hasConfigurationLimit", &JointModelDerived::hasConfigurationLimit,
40 "Return vector of boolean if joint has configuration limits.")
42 "hasConfigurationLimitInTangent", &JointModelDerived::hasConfigurationLimitInTangent,
43 "Return vector of boolean if joint has configuration limits in tangent space.")
44 .def(
"setIndexes", &setIndexes0, bp::args(
"self",
"joint_id",
"idx_q",
"idx_v"))
46 "setIndexes", &setIndexes1,
47 bp::args(
"self",
"joint_id",
"idx_q",
"idx_v",
"idx_vExtended"))
48 .def(
"classname", &JointModelDerived::classname)
49 .staticmethod(
"classname")
50 .def(
"calc", &calc0, bp::args(
"self",
"jdata",
"q"))
51 .def(
"calc", &calc1, bp::args(
"self",
"jdata",
"q",
"v"))
53 "createData", &JointModelDerived::createData, bp::arg(
"self"),
54 "Create data associated to the joint model.")
56 "hasSameIndexes", &JointModelDerived::template hasSameIndexes<JointModelDerived>,
57 bp::args(
"self",
"other"),
"Check if this has same indexes than other.")
59 "shortname", &JointModelDerived::shortname, bp::arg(
"self"),
60 "Returns string indicating the joint type (class name):" 61 "\n\t- JointModelR[*]: Revolute Joint, with rotation axis [*] ∈ [X,Y,Z]" 62 "\n\t- JointModelRevoluteUnaligned: Revolute Joint, with rotation axis not aligned " 64 "\n\t- JointModelRUB[*]: Unbounded revolute Joint (without position limits), with " 65 "rotation axis [*] ∈ [X,Y,Z]" 66 "\n\t- JointModelRevoluteUnboundedUnaligned: Unbounded revolute Joint, with rotation " 67 "axis not aligned with X, Y, nor Z" 68 "\n\t- JointModelP[*]: Prismatic Joint, with rotation axis [*] ∈ [X,Y,Z]" 69 "\n\t- JointModelPlanar: Planar joint" 70 "\n\t- JointModelPrismaticUnaligned: Prismatic joint, with translation axis not " 71 "aligned with X, Y, nor Z" 72 "\n\t- JointModelSphericalZYX: Spherical joint (3D rotation)" 73 "\n\t- JointModelTranslation: Translation joint (3D translation)" 74 "\n\t- JointModelFreeFlyer: Joint enabling 3D rotation and translations.")
76#ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS 77 .def(bp::self == bp::self)
78 .def(bp::self != bp::self)
83 static JointIndex get_id(
const JointModelDerived & self)
87 static int get_idx_q(
const JointModelDerived & self)
91 static int get_idx_v(
const JointModelDerived & self)
95 static int get_idx_vExtended(
const JointModelDerived & self)
97 return self.idx_vExtended();
99 static int get_nq(
const JointModelDerived & self)
103 static int get_nv(
const JointModelDerived & self)
107 static int get_nvExtended(
const JointModelDerived & self)
109 return self.nvExtended();
113 calc0(
const JointModelDerived & self, JointDataDerived & jdata,
const context::VectorXs & q)
118 const JointModelDerived & self,
119 JointDataDerived & jdata,
120 const context::VectorXs & q,
121 const context::VectorXs & v)
123 self.calc(jdata, q, v);
127 setIndexes0(JointModelDerived & self,
const int &
id,
const int & idx_q,
const int & idx_v)
129 self.setIndexes(
id, idx_q, idx_v);
132 static void setIndexes1(
133 JointModelDerived & self,
137 const int & idx_vExtended)
139 self.setIndexes(
id, idx_q, idx_v, idx_vExtended);
145 :
public boost::python::def_visitor<JointDataBasePythonVisitor<JointDataDerived>>
148 template<
class PyClass>
149 void visit(PyClass & cl)
const 153 .add_property(
"joint_q", &get_joint_q)
154 .add_property(
"joint_v", &get_joint_v)
155 .add_property(
"S", &get_S)
156 .add_property(
"M", &get_M)
157 .add_property(
"v", &get_v)
158 .add_property(
"c", &get_c)
159 .add_property(
"U", &get_U)
160 .add_property(
"Dinv", &get_Dinv)
161 .add_property(
"UDinv", &get_UDinv)
162 .def(
"shortname", &JointDataDerived::shortname, bp::arg(
"self"))
164#ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS 165 .def(bp::self == bp::self)
166 .def(bp::self != bp::self)
171 static typename JointDataDerived::ConfigVector_t get_joint_q(
const JointDataDerived & self)
173 return self.joint_q_accessor();
175 static typename JointDataDerived::TangentVector_t get_joint_v(
const JointDataDerived & self)
177 return self.joint_v_accessor();
181 static typename JointDataDerived::Constraint_t::DenseBase get_S(
const JointDataDerived & self)
183 return self.S_accessor().matrix();
185 static typename JointDataDerived::Transformation_t get_M(
const JointDataDerived & self)
187 return self.M_accessor();
189 static typename JointDataDerived::Motion_t get_v(
const JointDataDerived & self)
191 return self.v_accessor();
193 static typename JointDataDerived::Bias_t get_c(
const JointDataDerived & self)
195 return self.c_accessor();
197 static typename JointDataDerived::U_t get_U(
const JointDataDerived & self)
199 return self.U_accessor();
201 static typename JointDataDerived::D_t get_Dinv(
const JointDataDerived & self)
203 return self.Dinv_accessor();
205 static typename JointDataDerived::UD_t get_UDinv(
const JointDataDerived & self)
207 return self.UDinv_accessor();