| Directory: | ./ |
|---|---|
| File: | bindings/python/collision/expose-fcl.cpp |
| Date: | 2025-02-12 21:03:38 |
| 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 | 65 | void exposeFCL() | |
| 20 | { | ||
| 21 | namespace bp = boost::python; | ||
| 22 |
1/2✓ Branch 2 taken 65 times.
✗ Branch 3 not taken.
|
65 | bp::import("hppfcl"); |
| 23 | |||
| 24 | using namespace ::hpp::fcl; | ||
| 25 | |||
| 26 | // Register implicit conversion SE3 <=> ::hpp::fcl::Transform3f | ||
| 27 | 65 | bp::implicitly_convertible<SE3, Transform3f>(); | |
| 28 | 65 | bp::implicitly_convertible<Transform3f, SE3>(); | |
| 29 | |||
| 30 | // Expose serialization of basic geometries to binary buffers | ||
| 31 | 65 | serialize<TriangleP>(); | |
| 32 | 65 | serialize<Sphere>(); | |
| 33 | 65 | serialize<Capsule>(); | |
| 34 | 65 | serialize<Box>(); | |
| 35 | 65 | serialize<Cone>(); | |
| 36 | 65 | serialize<Cylinder>(); | |
| 37 | 65 | serialize<Plane>(); | |
| 38 | 65 | serialize<Halfspace>(); | |
| 39 | 65 | serialize<BVHModel<OBB>>(); | |
| 40 | 65 | serialize<BVHModel<RSS>>(); | |
| 41 | 65 | serialize<BVHModel<OBBRSS>>(); | |
| 42 | |||
| 43 | 65 | serialize<HeightField<OBBRSS>>(); | |
| 44 | 65 | serialize<HeightField<AABB>>(); | |
| 45 | 65 | } | |
| 46 | |||
| 47 | } // namespace python | ||
| 48 | } // namespace pinocchio | ||
| 49 |