GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/multibody/fcl/expose-fcl.cpp Lines: 16 16 100.0 %
Date: 2024-04-26 13:14:21 Branches: 1 2 50.0 %

Line Branch Exec Source
1
//
2
// Copyright (c) 2017-2021 CNRS INRIA
3
//
4
5
#include "pinocchio/bindings/python/fwd.hpp"
6
#include "pinocchio/bindings/python/multibody/fcl/transform.hpp"
7
#include "pinocchio/bindings/python/serialization/serialization.hpp"
8
9
#define HPP_FCL_SKIP_EIGEN_BOOST_SERIALIZATION
10
  #include <hpp/fcl/serialization/BVH_model.h>
11
  #include <hpp/fcl/serialization/geometric_shapes.h>
12
#undef HPP_FCL_SKIP_EIGEN_BOOST_SERIALIZATION
13
14
namespace pinocchio
15
{
16
  namespace python
17
  {
18
19
    void exposeFCL()
19
    {
20
      namespace bp = boost::python;
21
19
      bp::import("hppfcl");
22
23
      using namespace ::hpp::fcl;
24
25
      // Register implicit conversion SE3 <=> ::hpp::fcl::Transform3f
26
19
      bp::implicitly_convertible< SE3,Transform3f >();
27
19
      bp::implicitly_convertible< Transform3f,SE3 >();
28
29
      // Expose serialization of basic geometries to binary buffers
30
19
      serialize<TriangleP>();
31
19
      serialize<Sphere>();
32
19
      serialize<Capsule>();
33
19
      serialize<Box>();
34
19
      serialize<Cone>();
35
19
      serialize<Cylinder>();
36
19
      serialize<Plane>();
37
19
      serialize<Halfspace>();
38
39
19
      serialize< BVHModel<OBB> >();
40
19
      serialize< BVHModel<RSS> >();
41
19
      serialize< BVHModel<OBBRSS> >();
42
19
    }
43
44
  } // namespace python
45
} // namespace pinocchio