joint.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2021 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_python_multibody_joint_joint_hpp__
6 #define __pinocchio_python_multibody_joint_joint_hpp__
7 
8 #include <boost/python.hpp>
9 
10 #include "pinocchio/multibody/joint/joint-generic.hpp"
12 
13 namespace pinocchio
14 {
15  namespace python
16  {
17  namespace bp = boost::python;
18 
20  : public boost::python::def_visitor< JointModelPythonVisitor >
21  {
22 
23  template<class PyClass>
24  void visit(PyClass& cl) const
25  {
26  cl
27  .def(bp::init<>(bp::arg("self")))
28  // All are add_properties cause ReadOnly
29  .add_property("id",&getId)
30  .add_property("idx_q",&getIdx_q)
31  .add_property("idx_v",&getIdx_v)
32  .add_property("nq",&getNq)
33  .add_property("nv",&getNv)
34  .def("hasConfigurationLimit", &JointModel::hasConfigurationLimit,
35  "Return vector of boolean if joint has configuration limits.")
36  .def("hasConfigurationLimitInTangent", &JointModel::hasConfigurationLimitInTangent,
37  "Return vector of boolean if joint has configuration limits in tangent space.")
38  .def("setIndexes",
40  bp::args("self","id","idx_q","idx_v"))
41  .def("hasSameIndexes",
42  &JointModel::hasSameIndexes<JointModel>,
43  bp::args("self","other"),
44  "Check if this has same indexes than other.")
45  .def("shortname",
47  bp::arg("self"),
48  "Returns string indicating the joint type (class name):"
49  "\n\t- JointModelR[*]: Revolute Joint, with rotation axis [*] ∈ [X,Y,Z]"
50  "\n\t- JointModelRevoluteUnaligned: Revolute Joint, with rotation axis not aligned with X, Y, nor Z"
51  "\n\t- JointModelRUB[*]: Unbounded revolute Joint (without position limits), with rotation axis [*] ∈ [X,Y,Z]"
52  "\n\t- JointModelRevoluteUnboundedUnaligned: Unbounded revolute Joint, with rotation axis not aligned with X, Y, nor Z"
53  "\n\t- JointModelP[*]: Prismatic Joint, with rotation axis [*] ∈ [X,Y,Z]"
54  "\n\t- JointModelPlanar: Planar joint"
55  "\n\t- JointModelPrismaticUnaligned: Prismatic joint, with translation axis not aligned with X, Y, nor Z"
56  "\n\t- JointModelSphericalZYX: Spherical joint (3D rotation)"
57  "\n\t- JointModelTranslation: Translation joint (3D translation)"
58  "\n\t- JointModelFreeFlyer: Joint enabling 3D rotation and translations."
59  )
60 
61  .def(bp::self == bp::self)
62  .def(bp::self != bp::self)
63  ;
64  }
65 
66  static JointIndex getId( const JointModel & self ) { return self.id(); }
67  static int getIdx_q(const JointModel & self) {return self.idx_q();}
68  static int getIdx_v(const JointModel & self) {return self.idx_v();}
69  static int getNq(const JointModel & self) {return self.nq();}
70  static int getNv(const JointModel & self) {return self.nv();}
71 
72  static void expose()
73  {
74  bp::class_<JointModel>("JointModel",
75  "Generic Joint Model",
76  bp::no_init)
77  .def(bp::init<JointModel>(bp::args("self","other")))
80  ;
81  }
82 
83  };
84 
85 }} // namespace pinocchio::python
86 
87 #endif // ifndef __pinocchio_python_multibody_joint_joint_hpp__
static int getIdx_q(const JointModel &self)
Definition: joint.hpp:67
Set the Python method str and repr to use the overloading operator<<.
Definition: printable.hpp:21
void def(const char *name, Func func)
static int getNv(const JointModel &self)
Definition: joint.hpp:70
static int getNq(const JointModel &self)
Definition: joint.hpp:69
static int getIdx_v(const JointModel &self)
Definition: joint.hpp:68
void setIndexes(JointIndex id, int nq, int nv)
const std::vector< bool > hasConfigurationLimit() const
Main pinocchio namespace.
Definition: timings.cpp:28
const std::vector< bool > hasConfigurationLimitInTangent() const
void visit(PyClass &cl) const
Definition: joint.hpp:24
static JointIndex getId(const JointModel &self)
Definition: joint.hpp:66


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:31