module.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2022 CNRS INRIA
3 //
4 
11 
15 
16 #include <eigenpy/eigenpy.hpp>
17 #include <eigenpy/optional.hpp>
18 
19 namespace bp = boost::python;
20 using namespace pinocchio::python;
21 
22 BOOST_PYTHON_MODULE(PINOCCHIO_PYTHON_MODULE_NAME)
23 {
24  bp::docstring_options module_docstring_options(true, true, false);
25 
26  bp::scope().attr("__version__") = pinocchio::printVersion();
27  bp::scope().attr("__raw_version__") = bp::str(PINOCCHIO_VERSION);
29 
30  // Enable warnings
31  bp::import("warnings");
32 
33 #if defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE) \
34  && defined(PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS)
35  bp::import("hppfcl");
36 #endif
37 
40 
42  eigenpy::OptionalConverter<Eigen::Ref<context::VectorXs>, boost::optional>::registration();
44  const Eigen::Ref<const context::VectorXs>, boost::optional>::registration();
45 
46 #if defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
48 #endif
49 
50  bp::scope().attr("ScalarType") = getScalarType();
51 
52  bp::scope().attr("XAxis") = bp::object(bp::handle<>(
53  eigenpy::EigenToPy<context::Vector3s>::convert(pinocchio::XAxis::vector<context::Scalar>())));
54  bp::scope().attr("YAxis") = bp::object(bp::handle<>(
55  eigenpy::EigenToPy<context::Vector3s>::convert(pinocchio::YAxis::vector<context::Scalar>())));
56  bp::scope().attr("ZAxis") = bp::object(bp::handle<>(
57  eigenpy::EigenToPy<context::Vector3s>::convert(pinocchio::ZAxis::vector<context::Scalar>())));
58 
59  if (!register_symbolic_link_to_registered_type<::pinocchio::ReferenceFrame>())
60  {
61  bp::enum_<::pinocchio::ReferenceFrame>("ReferenceFrame")
62  .value("WORLD", ::pinocchio::WORLD)
63  .value("LOCAL", ::pinocchio::LOCAL)
64  .value("LOCAL_WORLD_ALIGNED", ::pinocchio::LOCAL_WORLD_ALIGNED)
65  .export_values();
66  }
67 
68  if (!register_symbolic_link_to_registered_type<::pinocchio::KinematicLevel>())
69  {
70  bp::enum_<::pinocchio::KinematicLevel>("KinematicLevel")
71  .value("POSITION", ::pinocchio::POSITION)
72  .value("VELOCITY", ::pinocchio::VELOCITY)
73  .value("ACCELERATION", ::pinocchio::ACCELERATION)
74  .export_values();
75  }
76 
77  if (!register_symbolic_link_to_registered_type<::pinocchio::Convention>())
78  {
79  bp::enum_<::pinocchio::Convention>("Convention")
80  .value("WORLD", ::pinocchio::Convention::WORLD)
81  .value("LOCAL", ::pinocchio::Convention::LOCAL);
82  }
83 
84  if (!register_symbolic_link_to_registered_type<::pinocchio::ArgumentPosition>())
85  {
86  bp::enum_<::pinocchio::ArgumentPosition>("ArgumentPosition")
87  .value("ARG0", ::pinocchio::ARG0)
88  .value("ARG1", ::pinocchio::ARG1)
89  .value("ARG2", ::pinocchio::ARG2)
90  .value("ARG3", ::pinocchio::ARG3)
91  .value("ARG4", ::pinocchio::ARG4)
92  .export_values();
93  }
94 
95  exposeSE3();
96  exposeForce();
97  exposeMotion();
98  exposeInertia();
100  exposeJoints();
101  exposeExplog();
102  exposeRpy();
103  exposeLinalg();
106  exposeSkew();
107  exposeLieGroups();
108 
109  exposeFrame();
110  exposeModel();
111  exposeData();
113 #if defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
114  exposeGeometry();
115  exposeParsers();
116 #endif // defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
117 
119  exposeExtras();
121 
122 #if defined(PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS) \
123  && defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
124  exposeFCL();
125  exposeCollision();
126 #endif // defined(PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS) &&
127  // defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
128 
129 #if defined(PINOCCHIO_PYTHON_INTERFACE_WITH_OPENMP) \
130  && defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
131  exposePool();
133 #endif
134 
135 #if defined(PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS) \
136  && defined(PINOCCHIO_PYTHON_INTERFACE_WITH_OPENMP) \
137  && defined(PINOCCHIO_PYTHON_INTERFACE_MAIN_MODULE)
140 #endif
141 
142  exposeVersion();
145 
146  typedef std::vector<::pinocchio::VectorXb> StdVec_VectorXb;
147  typedef std::vector<context::MatrixXs> StdVec_MatrixXs;
148 
153 }
optional.hpp
pinocchio::WORLD
@ WORLD
Definition: multibody/fwd.hpp:48
pinocchio::python::exposeSymmetric3
void exposeSymmetric3()
Definition: expose-symmetric3.cpp:18
pinocchio::python::exposeAlgorithms
void exposeAlgorithms()
Definition: expose-algorithms.cpp:12
boost::python
pinocchio::python::exposeConversions
void exposeConversions()
Definition: conversions.cpp:122
eigenpy::OptionalConverter
pinocchio::python::exposeParallelAlgorithms
void exposeParallelAlgorithms()
Definition: algorithm/parallel/expose-parallel.cpp:17
eigenpy.hpp
pinocchio::python::exposeMotion
void exposeMotion()
Definition: expose-motion.cpp:19
registration.hpp
eigenpy::enableEigenPy
void EIGENPY_DLLAPI enableEigenPy()
pinocchio::ACCELERATION
@ ACCELERATION
Definition: multibody/fwd.hpp:65
pinocchio::Convention::WORLD
@ WORLD
eigenpy::EigenToPy
pinocchio::ARG3
@ ARG3
Definition: fwd.hpp:126
version.hpp
pinocchio::python::exposeJoints
void exposeJoints()
Definition: multibody/joint/expose-joints.cpp:18
pinocchio::ARG0
@ ARG0
Definition: fwd.hpp:123
eigenpy::StdContainerFromPythonList
serialization.hpp
pinocchio::LOCAL_WORLD_ALIGNED
@ LOCAL_WORLD_ALIGNED
Definition: multibody/fwd.hpp:52
pinocchio::python::getScalarType
boost::python::object getScalarType()
Definition: boost_number.cpp:19
pinocchio::python::exposeModel
void exposeModel()
Definition: multibody/expose-model.cpp:13
version.hpp
pinocchio::python::exposeFrame
void exposeFrame()
Definition: expose-frame.cpp:18
pinocchio::python::exposeSE3
void exposeSE3()
Definition: expose-SE3.cpp:18
eigenpy::details::overload_base_get_item_for_std_vector
cartesian-axis.hpp
pinocchio::ARG2
@ ARG2
Definition: fwd.hpp:125
pinocchio::python::exposeSpecificTypeFeatures
void exposeSpecificTypeFeatures()
Definition: boost_number.cpp:14
pinocchio::python::exposeGeometry
void exposeGeometry()
Definition: multibody/expose-geometry.cpp:16
pinocchio::python::exposePoolCollision
void exposePoolCollision()
Definition: collision/pool/expose-pool.cpp:25
pinocchio::python::exposeForce
void exposeForce()
Definition: expose-force.cpp:18
pinocchio::ARG1
@ ARG1
Definition: fwd.hpp:124
pinocchio::python::exposeExtras
void exposeExtras()
Definition: expose-extras.cpp:12
pinocchio::python::exposeParsers
void exposeParsers()
Definition: expose-parsers.cpp:15
pinocchio::python::exposeLanczosDecomposition
void exposeLanczosDecomposition()
Definition: expose-lanczos-decomposition.cpp:14
pinocchio::python
Definition: admm-solver.cpp:22
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(PINOCCHIO_PYTHON_MODULE_NAME)
Definition: module.cpp:22
pinocchio::printVersion
std::string printVersion(const std::string &delimiter=".")
Returns the current version of Pinocchio as a string using the following standard: PINOCCHIO_MINOR_VE...
Definition: utils/version.hpp:21
pinocchio::python::exposeDependencies
void exposeDependencies()
Definition: dependencies.cpp:14
pinocchio::python::exposeTridiagonalMatrix
void exposeTridiagonalMatrix()
Definition: expose-tridiagonal-matrix.cpp:14
pinocchio::ARG4
@ ARG4
Definition: fwd.hpp:127
eigenpy::StdVectorPythonVisitor::expose
static void expose(const std::string &class_name, const bp::def_visitor< DerivedVisitor > &visitor)
pinocchio::python::exposeSkew
void exposeSkew()
Definition: expose-skew.cpp:41
pinocchio::python::exposeRpy
void exposeRpy()
Definition: expose-rpy.cpp:41
pinocchio::python::exposeInertia
void exposeInertia()
Definition: expose-inertia.cpp:18
pinocchio::python::exposeFCL
void exposeFCL()
Definition: expose-fcl.cpp:19
dependencies.hpp
pinocchio::python::exposeLieGroups
void exposeLieGroups()
Definition: expose-liegroups.cpp:41
pinocchio::python::exposeData
void exposeData()
Definition: expose-data.cpp:13
eigenpy::OptionalConverter::registration
static void registration()
pinocchio::python::exposeParallelCollision
void exposeParallelCollision()
Definition: collision/parallel/expose-parallel.cpp:17
pinocchio::python::exposeVersion
void exposeVersion()
Definition: bindings/python/utils/version.cpp:18
pinocchio::Convention::LOCAL
@ LOCAL
fwd.hpp
pinocchio::python::exposeLinalg
void exposeLinalg()
Definition: expose-linalg.cpp:25
pinocchio::python::exposeSampleModels
void exposeSampleModels()
Definition: bindings/python/multibody/sample-models.cpp:68
pinocchio::POSITION
@ POSITION
Definition: multibody/fwd.hpp:61
pinocchio::python::exposePool
void exposePool()
Definition: multibody/pool/expose-pool.cpp:13
pinocchio::VELOCITY
@ VELOCITY
Definition: multibody/fwd.hpp:63
std-vector.hpp
pinocchio::python::exposeEigenTypes
void exposeEigenTypes()
Definition: expose-eigen-types.cpp:55
fwd.hpp
pinocchio::python::exposeCollision
void exposeCollision()
Definition: expose-collision.cpp:35
pinocchio::python::exposeSerialization
void exposeSerialization()
Definition: bindings/python/serialization/serialization.cpp:43
pinocchio::python::exposeExplog
void exposeExplog()
Definition: expose-explog.cpp:17
pinocchio::LOCAL
@ LOCAL
Definition: multibody/fwd.hpp:50


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:11