Directory: | ./ |
---|---|
File: | bindings/python/collision/expose-fcl.cpp |
Date: | 2024-08-27 18:20:05 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 18 | 18 | 100.0% |
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/collision/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/hfield.h> | ||
12 | #include <hpp/fcl/serialization/geometric_shapes.h> | ||
13 | #undef HPP_FCL_SKIP_EIGEN_BOOST_SERIALIZATION | ||
14 | |||
15 | namespace pinocchio | ||
16 | { | ||
17 | namespace python | ||
18 | { | ||
19 | 20 | void exposeFCL() | |
20 | { | ||
21 | namespace bp = boost::python; | ||
22 |
1/2✓ Branch 2 taken 20 times.
✗ Branch 3 not taken.
|
20 | bp::import("hppfcl"); |
23 | |||
24 | using namespace ::hpp::fcl; | ||
25 | |||
26 | // Register implicit conversion SE3 <=> ::hpp::fcl::Transform3f | ||
27 | 20 | bp::implicitly_convertible<SE3, Transform3f>(); | |
28 | 20 | bp::implicitly_convertible<Transform3f, SE3>(); | |
29 | |||
30 | // Expose serialization of basic geometries to binary buffers | ||
31 | 20 | serialize<TriangleP>(); | |
32 | 20 | serialize<Sphere>(); | |
33 | 20 | serialize<Capsule>(); | |
34 | 20 | serialize<Box>(); | |
35 | 20 | serialize<Cone>(); | |
36 | 20 | serialize<Cylinder>(); | |
37 | 20 | serialize<Plane>(); | |
38 | 20 | serialize<Halfspace>(); | |
39 | 20 | serialize<BVHModel<OBB>>(); | |
40 | 20 | serialize<BVHModel<RSS>>(); | |
41 | 20 | serialize<BVHModel<OBBRSS>>(); | |
42 | |||
43 | 20 | serialize<HeightField<OBBRSS>>(); | |
44 | 20 | serialize<HeightField<AABB>>(); | |
45 | 20 | } | |
46 | |||
47 | } // namespace python | ||
48 | } // namespace pinocchio | ||
49 |