33 #ifndef DART_COLLISION_FCL_BACKWARDCOMPATIBILITY_HPP_
34 #define DART_COLLISION_FCL_BACKWARDCOMPATIBILITY_HPP_
36 #include "dart/config.hpp"
38 #include <Eigen/Dense>
41 #define FCL_VERSION_AT_LEAST(x,y,z) \
42 (FCL_MAJOR_VERSION > x || (FCL_MAJOR_VERSION >= x && \
43 (FCL_MINOR_VERSION > y || (FCL_MINOR_VERSION >= y && \
44 FCL_PATCH_VERSION >= z))))
46 #define FCL_MAJOR_MINOR_VERSION_AT_MOST(x,y) \
47 (FCL_MAJOR_VERSION < x || (FCL_MAJOR_VERSION <= x && \
48 (FCL_MINOR_VERSION < y || (FCL_MINOR_VERSION <= y))))
51 #include <fcl/config.h>
53 #if FCL_VERSION_AT_LEAST(0, 6, 0)
55 # include <fcl/math/geometry.h>
57 # include <fcl/geometry/bvh/BVH_model.h>
58 # include <fcl/geometry/geometric_shape_to_BVH_model.h>
59 # include <fcl/math/bv/OBBRSS.h>
60 # include <fcl/math/bv/utility.h>
61 # include <fcl/narrowphase/collision.h>
62 # include <fcl/narrowphase/collision_object.h>
63 # include <fcl/narrowphase/distance.h>
67 # include <fcl/math/matrix_3f.h>
68 # include <fcl/math/transform.h>
69 # include <fcl/math/vec_3f.h>
71 # include <fcl/BV/OBBRSS.h>
72 # include <fcl/BVH/BVH_model.h>
73 # include <fcl/shape/geometric_shape_to_BVH_model.h>
74 # include <fcl/collision.h>
75 # include <fcl/collision_data.h>
76 # include <fcl/collision_object.h>
77 # include <fcl/distance.h>
81 #include <fcl/broadphase/broadphase_dynamic_AABB_tree.h>
83 #if HAVE_OCTOMAP && FCL_HAVE_OCTOMAP
84 # if FCL_VERSION_AT_LEAST(0, 6, 0)
85 # include <fcl/geometry/octree/octree.h>
87 # include <fcl/octree.h>
91 #if FCL_VERSION_AT_LEAST(0, 5, 0)
97 template <
class T,
class... Args>
100 return std::make_shared<T>(std::forward<Args>(args)...);
103 # include <boost/make_shared.hpp>
104 # include <boost/weak_ptr.hpp>
109 template <
class T,
class... Args>
112 return boost::make_shared<T>(std::forward<Args>(args)...);
117 namespace collision {
120 #if FCL_VERSION_AT_LEAST(0, 6, 0)
122 using Vector3 = ::fcl::Vector3<double>;
123 using Matrix3 = ::fcl::Matrix3<double>;
126 using Box = ::fcl::Box<double>;
127 using Cylinder = ::fcl::Cylinder<double>;
128 using Cone = ::fcl::Cone<double>;
129 using Ellipsoid = ::fcl::Ellipsoid<double>;
130 using Halfspace = ::fcl::Halfspace<double>;
131 using Sphere = ::fcl::Sphere<double>;
132 # if HAVE_OCTOMAP && FCL_HAVE_OCTOMAP
133 using OcTree = ::fcl::OcTree<double>;
139 = ::fcl::DynamicAABBTreeCollisionManager<double>;
140 using OBBRSS = ::fcl::OBBRSS<double>;
145 using Contact = ::fcl::Contact<double>;
157 # if HAVE_OCTOMAP && FCL_HAVE_OCTOMAP
158 using OcTree = ::fcl::OcTree;
172 #if FCL_VERSION_AT_LEAST(0, 4, 0) && !FCL_VERSION_AT_LEAST(0, 6, 0)
173 using Ellipsoid = ::fcl::Ellipsoid;
boost::weak_ptr< T > fcl_weak_ptr
Definition: BackwardCompatibility.hpp:108
boost::shared_ptr< T > fcl_shared_ptr
Definition: BackwardCompatibility.hpp:106
fcl_shared_ptr< T > fcl_make_shared(Args &&... args)
Definition: BackwardCompatibility.hpp:110
::fcl::CollisionGeometry CollisionGeometry
Definition: BackwardCompatibility.hpp:162
void setTranslation(dart::collision::fcl::Transform3 &T, const dart::collision::fcl::Vector3 &t)
Sets translation component of a transform.
Definition: BackwardCompatibility.cpp:71
::fcl::CollisionObject CollisionObject
Definition: BackwardCompatibility.hpp:161
::fcl::Sphere Sphere
Definition: BackwardCompatibility.hpp:156
void setEulerZYX(dart::collision::fcl::Matrix3 &rot, double eulerX, double eulerY, double eulerZ)
Sets a rotation matrix given Euler-XYZ angles.
Definition: BackwardCompatibility.cpp:104
double length(const dart::collision::fcl::Vector3 &t)
Returns norm of a 3-dim vector.
Definition: BackwardCompatibility.cpp:40
double length2(const dart::collision::fcl::Vector3 &t)
Returns squared norm of a 3-dim vector.
Definition: BackwardCompatibility.cpp:50
::fcl::OBBRSS OBBRSS
Definition: BackwardCompatibility.hpp:164
void setRotation(dart::collision::fcl::Transform3 &T, const dart::collision::fcl::Matrix3 &R)
Sets rotation component of a transform.
Definition: BackwardCompatibility.cpp:93
::fcl::Cone Cone
Definition: BackwardCompatibility.hpp:154
::fcl::CollisionResult CollisionResult
Definition: BackwardCompatibility.hpp:166
::fcl::Halfspace Halfspace
Definition: BackwardCompatibility.hpp:155
::fcl::DynamicAABBTreeCollisionManager DynamicAABBTreeCollisionManager
Definition: BackwardCompatibility.hpp:163
::fcl::Vec3f Vector3
Definition: BackwardCompatibility.hpp:148
dart::collision::fcl::Vector3 transform(const dart::collision::fcl::Transform3 &t, const dart::collision::fcl::Vector3 &v)
Transforms a 3-dim vector by a transform and returns the result.
Definition: BackwardCompatibility.cpp:133
::fcl::Cylinder Cylinder
Definition: BackwardCompatibility.hpp:153
::fcl::Transform3f Transform3
Definition: BackwardCompatibility.hpp:150
::fcl::CollisionRequest CollisionRequest
Definition: BackwardCompatibility.hpp:165
::fcl::DistanceResult DistanceResult
Definition: BackwardCompatibility.hpp:168
::fcl::Matrix3f Matrix3
Definition: BackwardCompatibility.hpp:149
dart::collision::fcl::Vector3 getTranslation(const dart::collision::fcl::Transform3 &T)
Returns translation component of a transform.
Definition: BackwardCompatibility.cpp:60
dart::collision::fcl::Matrix3 getRotation(const dart::collision::fcl::Transform3 &T)
Returns rotation component of a transform.
Definition: BackwardCompatibility.cpp:82
::fcl::Box Box
Definition: BackwardCompatibility.hpp:152
::fcl::Contact Contact
Definition: BackwardCompatibility.hpp:169
::fcl::DistanceRequest DistanceRequest
Definition: BackwardCompatibility.hpp:167
Definition: BulletCollisionDetector.cpp:65