joints-datas.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019-2020 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_python_joints_datas_hpp__
6 #define __pinocchio_python_joints_datas_hpp__
7 
8 #include <boost/python.hpp>
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14  namespace bp = boost::python;
15 
16  // generic expose_joint_data : do nothing special
17  template <class T>
18  inline bp::class_<T>& expose_joint_data(bp::class_<T>& cl)
19  {
20  return cl;
21  }
22 
23  // specialization for JointDataRevoluteUnaligned
24  template<>
25  inline bp::class_<JointDataRevoluteUnaligned>& expose_joint_data<JointDataRevoluteUnaligned> (bp::class_<JointDataRevoluteUnaligned> & cl)
26  {
27  return cl
28  .def(bp::init<Eigen::Vector3d> (bp::args("axis"), "Init JointDataRevoluteUnaligned from an axis with x-y-z components"))
29  ;
30  }
31 
32  // specialization for JointDataPrismaticUnaligned
33  template<>
34  inline bp::class_<JointDataPrismaticUnaligned>& expose_joint_data<JointDataPrismaticUnaligned> (bp::class_<JointDataPrismaticUnaligned> & cl)
35  {
36  return cl
37  .def(bp::init<Eigen::Vector3d> (bp::args("axis"), "Init JointDataPrismaticUnaligned from an axis with x-y-z components"))
38  ;
39  }
40 
41  template<>
42  inline bp::class_<JointDataPlanar>& expose_joint_data<JointDataPlanar> (bp::class_<JointDataPlanar> & cl)
43  {
44  return cl
45  .add_property("StU",&JointDataPlanar::StU)
46  ;
47  }
48 
49 
50  template<>
51  inline bp::class_<JointDataSphericalZYX>& expose_joint_data<JointDataSphericalZYX> (bp::class_<JointDataSphericalZYX> & cl)
52  {
53  return cl
54  .add_property("StU",&JointDataSphericalZYX::StU)
55  ;
56  }
57 
58  template<>
59  inline bp::class_<JointDataComposite>& expose_joint_data<JointDataComposite> (bp::class_<JointDataComposite> & cl)
60  {
61  return cl
62  .def(bp::init<const JointDataComposite::JointDataVector&, const int, const int>
63  (bp::args("joint_data_vectors", "nq", "nv"),
64  "Init JointDataComposite from a given collection of joint data"))
65  .add_property("joints",&JointDataComposite::joints)
66  .add_property("iMlast",&JointDataComposite::iMlast)
67  .add_property("pjMi",&JointDataComposite::pjMi)
68  .add_property("StU",&JointDataComposite::StU)
69  ;
70  }
71 
72  } // namespace python
73 } // namespace pinocchio
74 
75 #endif // ifndef __pinocchio_python_joint_datas_hpp__
bp::class_< JointDataRevoluteUnaligned > & expose_joint_data< JointDataRevoluteUnaligned >(bp::class_< JointDataRevoluteUnaligned > &cl)
bp::class_< JointDataSphericalZYX > & expose_joint_data< JointDataSphericalZYX >(bp::class_< JointDataSphericalZYX > &cl)
bp::class_< T > & expose_joint_data(bp::class_< T > &cl)
bp::class_< JointDataComposite > & expose_joint_data< JointDataComposite >(bp::class_< JointDataComposite > &cl)
JointDataVector joints
Vector of joints.
bp::class_< JointDataPlanar > & expose_joint_data< JointDataPlanar >(bp::class_< JointDataPlanar > &cl)
Main pinocchio namespace.
Definition: timings.cpp:28
cl
bp::class_< JointDataPrismaticUnaligned > & expose_joint_data< JointDataPrismaticUnaligned >(bp::class_< JointDataPrismaticUnaligned > &cl)


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