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("setIndexes",
36  bp::args("self","id","idx_q","idx_v"))
37  .def("hasSameIndexes",
38  &JointModel::hasSameIndexes<JointModel>,
39  bp::args("self","other"),
40  "Check if this has same indexes than other.")
41  .def("shortname",&JointModel::shortname,bp::arg("self"))
42 
43  .def(bp::self == bp::self)
44  .def(bp::self != bp::self)
45  ;
46  }
47 
48  static JointIndex getId( const JointModel & self ) { return self.id(); }
49  static int getIdx_q(const JointModel & self) {return self.idx_q();}
50  static int getIdx_v(const JointModel & self) {return self.idx_v();}
51  static int getNq(const JointModel & self) {return self.nq();}
52  static int getNv(const JointModel & self) {return self.nv();}
53 
54  static void expose()
55  {
56  bp::class_<JointModel>("JointModel",
57  "Generic Joint Model",
58  bp::no_init)
59  .def(bp::init<JointModel>(bp::args("self","other")))
62  ;
63  }
64 
65  };
66 
67 }} // namespace pinocchio::python
68 
69 #endif // ifndef __pinocchio_python_multibody_joint_joint_hpp__
static int getIdx_q(const JointModel &self)
Definition: joint.hpp:49
Set the Python method str and repr to use the overloading operator<<.
Definition: printable.hpp:21
static int getNv(const JointModel &self)
Definition: joint.hpp:52
static int getNq(const JointModel &self)
Definition: joint.hpp:51
static int getIdx_v(const JointModel &self)
Definition: joint.hpp:50
void visit(PyClass &cl) const
Definition: joint.hpp:24
void setIndexes(JointIndex id, int nq, int nv)
Main pinocchio namespace.
Definition: timings.cpp:30
static JointIndex getId(const JointModel &self)
Definition: joint.hpp:48


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:04