GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/module.cpp Lines: 53 53 100.0 %
Date: 2024-04-26 13:14:21 Branches: 62 124 50.0 %

Line Branch Exec Source
1
//
2
// Copyright (c) 2015-2021 CNRS INRIA
3
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4
//
5
6
#include "pinocchio/bindings/python/fwd.hpp"
7
#include "pinocchio/multibody/fwd.hpp"
8
#include "pinocchio/utils/version.hpp"
9
#include "pinocchio/bindings/python/utils/version.hpp"
10
#include "pinocchio/bindings/python/utils/dependencies.hpp"
11
#include "pinocchio/bindings/python/utils/conversions.hpp"
12
#include "pinocchio/bindings/python/utils/registration.hpp"
13
14
#include "pinocchio/bindings/python/utils/std-vector.hpp"
15
#include "pinocchio/bindings/python/serialization/serialization.hpp"
16
17
#include <eigenpy/eigenpy.hpp>
18
19
#include <Eigen/Geometry>
20
#include <eigenpy/geometry.hpp>
21
22
namespace bp = boost::python;
23
using namespace pinocchio::python;
24
25

76
BOOST_PYTHON_MODULE(pinocchio_pywrap)
26
{
27
76
  bp::docstring_options module_docstring_options(true,true,false);
28
29


38
  bp::scope().attr("__version__") = pinocchio::printVersion();
30


38
  bp::scope().attr("__raw_version__") = bp::str(PINOCCHIO_VERSION);
31
38
  eigenpy::enableEigenPy();
32
33
  // Enable warnings
34

38
  bp::import("warnings");
35
36

38
  if(! register_symbolic_link_to_registered_type<Eigen::Quaterniond>())
37
38
    eigenpy::exposeQuaternion();
38

38
  if(! register_symbolic_link_to_registered_type<Eigen::AngleAxisd>())
39
38
    eigenpy::exposeAngleAxis();
40
41
38
  StdContainerFromPythonList< std::vector<std::string> >::register_converter();
42
43
  typedef Eigen::Matrix<double,6,6> Matrix6d;
44
  typedef Eigen::Matrix<double,6,1> Vector6d;
45
  typedef Eigen::Matrix<double,6,Eigen::Dynamic> Matrix6x;
46
  typedef Eigen::Matrix<double,3,Eigen::Dynamic> Matrix3x;
47
48
38
  eigenpy::enableEigenPySpecific<Matrix6d>();
49
38
  eigenpy::enableEigenPySpecific<Vector6d>();
50
38
  eigenpy::enableEigenPySpecific<Matrix6x>();
51
38
  eigenpy::enableEigenPySpecific<Matrix3x>();
52
53
38
  exposeSE3();
54
38
  exposeForce();
55
38
  exposeMotion();
56
38
  exposeInertia();
57
38
  exposeJoints();
58
38
  exposeExplog();
59
38
  exposeRpy();
60
38
  exposeSkew();
61
38
  exposeLieGroups();
62
63
76
  bp::enum_< ::pinocchio::ReferenceFrame >("ReferenceFrame")
64
38
  .value("WORLD",::pinocchio::WORLD)
65
38
  .value("LOCAL",::pinocchio::LOCAL)
66
38
  .value("LOCAL_WORLD_ALIGNED",::pinocchio::LOCAL_WORLD_ALIGNED)
67
38
  .export_values()
68
  ;
69
70
76
  bp::enum_< ::pinocchio::KinematicLevel >("KinematicLevel")
71
38
  .value("POSITION",::pinocchio::POSITION)
72
38
  .value("VELOCITY",::pinocchio::VELOCITY)
73
38
  .value("ACCELERATION",::pinocchio::ACCELERATION)
74
38
  .export_values()
75
  ;
76
77
76
  bp::enum_< ::pinocchio::ArgumentPosition>("ArgumentPosition")
78
38
  .value("ARG0",::pinocchio::ARG0)
79
38
  .value("ARG1",::pinocchio::ARG1)
80
38
  .value("ARG2",::pinocchio::ARG2)
81
38
  .value("ARG3",::pinocchio::ARG3)
82
38
  .value("ARG4",::pinocchio::ARG4)
83
38
  .export_values()
84
  ;
85
86
38
  exposeModel();
87
38
  exposeFrame();
88
38
  exposeData();
89
38
  exposeGeometry();
90
91
38
  exposeAlgorithms();
92
38
  exposeParsers();
93
38
  exposeSerialization();
94
95
#ifdef PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS
96
38
  exposeFCL();
97
#endif // PINOCCHIO_PYTHON_INTERFACE_WITH_HPP_FCL_PYTHON_BINDINGS
98
99
#ifdef PINOCCHIO_PYTHON_INTERFACE_WITH_OPENMP
100
  exposePool();
101
  exposeParallelAlgorithms();
102
#endif
103
104
38
  exposeVersion();
105
38
  exposeDependencies();
106
38
  exposeConversions();
107
108
38
}
109