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 namespace pinocchio
9 {
10  namespace python
11  {
12  namespace bp = boost::python;
13 
14  // generic expose_joint_data : do nothing special
15  template<class T>
16  inline bp::class_<T> & expose_joint_data(bp::class_<T> & cl)
17  {
18  return cl;
19  }
20 
21  // specialization for JointDataRevoluteUnaligned
22  template<>
23  inline bp::class_<JointDataRevoluteUnaligned> &
24  expose_joint_data<JointDataRevoluteUnaligned>(bp::class_<JointDataRevoluteUnaligned> & cl)
25  {
26  return cl.def(bp::init<const Eigen::Vector3d &>(
27  bp::args("axis"), "Init JointDataRevoluteUnaligned from an axis with x-y-z components"));
28  }
29 
30  // specialization for JointDataPrismaticUnaligned
31  template<>
32  inline bp::class_<JointDataPrismaticUnaligned> &
33  expose_joint_data<JointDataPrismaticUnaligned>(bp::class_<JointDataPrismaticUnaligned> & cl)
34  {
35  return cl.def(bp::init<const Eigen::Vector3d &>(
36  bp::args("axis"), "Init JointDataPrismaticUnaligned from an axis with x-y-z components"));
37  }
38 
39  // specialization for JointDataHelicalUnaligned
40  template<>
41  inline bp::class_<JointDataHelicalUnaligned> &
42  expose_joint_data<JointDataHelicalUnaligned>(bp::class_<JointDataHelicalUnaligned> & cl)
43  {
44  return cl.def(bp::init<const Eigen::Vector3d &>(
45  bp::args("axis"), "Init JointDataHelicalUnaligned from an axis with x-y-z components"));
46  }
47 
48  template<>
49  inline bp::class_<JointDataPlanar> &
50  expose_joint_data<JointDataPlanar>(bp::class_<JointDataPlanar> & cl)
51  {
52  return cl.add_property("StU", &JointDataPlanar::StU);
53  }
54 
55  template<>
56  inline bp::class_<JointDataSphericalZYX> &
57  expose_joint_data<JointDataSphericalZYX>(bp::class_<JointDataSphericalZYX> & cl)
58  {
59  return cl.add_property("StU", &JointDataSphericalZYX::StU);
60  }
61 
62  template<>
63  inline bp::class_<JointDataComposite> &
64  expose_joint_data<JointDataComposite>(bp::class_<JointDataComposite> & cl)
65  {
66  return cl
67  .def(bp::init<const JointDataComposite::JointDataVector &, const int, const int>(
68  bp::args("joint_data_vectors", "nq", "nv"),
69  "Init JointDataComposite from a given collection of joint data"))
70  .add_property("joints", &JointDataComposite::joints)
71  .add_property("iMlast", &JointDataComposite::iMlast)
72  .add_property("pjMi", &JointDataComposite::pjMi)
73  .add_property("StU", &JointDataComposite::StU);
74  }
75 
76  } // namespace python
77 } // namespace pinocchio
78 
79 #endif // ifndef __pinocchio_python_joint_datas_hpp__
boost::python
pinocchio::python::expose_joint_data
bp::class_< T > & expose_joint_data(bp::class_< T > &cl)
Definition: joints-datas.hpp:16
pinocchio::python::expose_joint_data< JointDataRevoluteUnaligned >
bp::class_< JointDataRevoluteUnaligned > & expose_joint_data< JointDataRevoluteUnaligned >(bp::class_< JointDataRevoluteUnaligned > &cl)
Definition: joints-datas.hpp:24
pinocchio::python::expose_joint_data< JointDataSphericalZYX >
bp::class_< JointDataSphericalZYX > & expose_joint_data< JointDataSphericalZYX >(bp::class_< JointDataSphericalZYX > &cl)
Definition: joints-datas.hpp:57
pinocchio::JointDataCompositeTpl::joints
JointDataVector joints
Vector of joints.
Definition: joint-composite.hpp:120
pinocchio::python::expose_joint_data< JointDataComposite >
bp::class_< JointDataComposite > & expose_joint_data< JointDataComposite >(bp::class_< JointDataComposite > &cl)
Definition: joints-datas.hpp:64
pinocchio::JointDataCompositeTpl::StU
D_t StU
Definition: joint-composite.hpp:140
pinocchio::JointDataSphericalZYXTpl::StU
D_t StU
Definition: joint-spherical-ZYX.hpp:342
pinocchio::python::expose_joint_data< JointDataPlanar >
bp::class_< JointDataPlanar > & expose_joint_data< JointDataPlanar >(bp::class_< JointDataPlanar > &cl)
Definition: joints-datas.hpp:50
python
pinocchio::JointDataPlanarTpl::StU
D_t StU
Definition: joint-planar.hpp:532
pinocchio::python::expose_joint_data< JointDataPrismaticUnaligned >
bp::class_< JointDataPrismaticUnaligned > & expose_joint_data< JointDataPrismaticUnaligned >(bp::class_< JointDataPrismaticUnaligned > &cl)
Definition: joints-datas.hpp:33
cl
cl
pinocchio::python::expose_joint_data< JointDataHelicalUnaligned >
bp::class_< JointDataHelicalUnaligned > & expose_joint_data< JointDataHelicalUnaligned >(bp::class_< JointDataHelicalUnaligned > &cl)
Definition: joints-datas.hpp:42
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:31