Verified Commit 203e9663 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

all: fix HPP_FCL_HAS_OCTOMAP

Previously, it was name
parent 991b9195
...@@ -92,14 +92,14 @@ endif () ...@@ -92,14 +92,14 @@ endif ()
# Optional dependencies # Optional dependencies
ADD_PROJECT_DEPENDENCY(octomap PKG_CONFIG_REQUIRES "octomap >= 1.6") ADD_PROJECT_DEPENDENCY(octomap PKG_CONFIG_REQUIRES "octomap >= 1.6")
if(octomap_FOUND) if(octomap_FOUND)
SET(HPP_FCL_HAVE_OCTOMAP TRUE) SET(HPP_FCL_HAS_OCTOMAP TRUE)
string(REPLACE "." ";" VERSION_LIST ${octomap_VERSION}) string(REPLACE "." ";" VERSION_LIST ${octomap_VERSION})
list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION) list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION)
list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION) list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION)
list(GET VERSION_LIST 2 OCTOMAP_PATCH_VERSION) list(GET VERSION_LIST 2 OCTOMAP_PATCH_VERSION)
message(STATUS "FCL uses Octomap") message(STATUS "FCL uses Octomap")
else() else()
SET(HPP_FCL_HAVE_OCTOMAP FALSE) SET(HPP_FCL_HAS_OCTOMAP FALSE)
message(STATUS "FCL does not use Octomap") message(STATUS "FCL does not use Octomap")
endif() endif()
...@@ -184,11 +184,11 @@ endif () ...@@ -184,11 +184,11 @@ endif ()
add_subdirectory(test) add_subdirectory(test)
pkg_config_append_libs("hpp-fcl") pkg_config_append_libs("hpp-fcl")
IF(HPP_FCL_HAVE_OCTOMAP) IF(HPP_FCL_HAS_OCTOMAP)
# FCL_HAVE_OCTOMAP kept for backward compatibility reasons. # FCL_HAVE_OCTOMAP kept for backward compatibility reasons.
PKG_CONFIG_APPEND_CFLAGS( PKG_CONFIG_APPEND_CFLAGS(
"-DHPP_FCL_HAVE_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}") "-DHPP_FCL_HAS_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}")
ENDIF(HPP_FCL_HAVE_OCTOMAP) ENDIF(HPP_FCL_HAS_OCTOMAP)
# Install catkin package.xml # Install catkin package.xml
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME}) INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
namespace hpp namespace hpp
{ {
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
#define HPP_FCL_HAVE_OCTOMAP
#define OCTOMAP_VERSION_AT_LEAST(x,y,z) \ #define OCTOMAP_VERSION_AT_LEAST(x,y,z) \
(OCTOMAP_MAJOR_VERSION > x || (OCTOMAP_MAJOR_VERSION >= x && \ (OCTOMAP_MAJOR_VERSION > x || (OCTOMAP_MAJOR_VERSION >= x && \
(OCTOMAP_MINOR_VERSION > y || (OCTOMAP_MINOR_VERSION >= y && \ (OCTOMAP_MINOR_VERSION > y || (OCTOMAP_MINOR_VERSION >= y && \
...@@ -56,7 +57,7 @@ namespace hpp ...@@ -56,7 +57,7 @@ namespace hpp
(OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x && \ (OCTOMAP_MAJOR_VERSION < x || (OCTOMAP_MAJOR_VERSION <= x && \
(OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y && \ (OCTOMAP_MINOR_VERSION < y || (OCTOMAP_MINOR_VERSION <= y && \
OCTOMAP_PATCH_VERSION <= z)))) OCTOMAP_PATCH_VERSION <= z))))
#endif // HPP_FCL_HAVE_OCTOMAP #endif // HPP_FCL_HAS_OCTOMAP
} }
namespace hpp namespace hpp
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <hpp/fcl/internal/traversal_node_shapes.h> #include <hpp/fcl/internal/traversal_node_shapes.h>
#include <hpp/fcl/internal/traversal_node_bvh_shape.h> #include <hpp/fcl/internal/traversal_node_bvh_shape.h>
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
#include <hpp/fcl/internal/traversal_node_octree.h> #include <hpp/fcl/internal/traversal_node_octree.h>
#endif #endif
...@@ -56,7 +56,7 @@ namespace hpp ...@@ -56,7 +56,7 @@ namespace hpp
namespace fcl namespace fcl
{ {
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
/// @brief Initialize traversal node for collision between two octrees, given current object transform /// @brief Initialize traversal node for collision between two octrees, given current object transform
inline bool initialize(OcTreeCollisionTraversalNode& node, inline bool initialize(OcTreeCollisionTraversalNode& node,
const OcTree& model1, const Transform3f& tf1, const OcTree& model1, const Transform3f& tf1,
......
...@@ -202,7 +202,7 @@ IF(octomap_FOUND) ...@@ -202,7 +202,7 @@ IF(octomap_FOUND)
target_include_directories(${LIBRARY_NAME} SYSTEM PUBLIC ${OCTOMAP_INCLUDE_DIRS}) target_include_directories(${LIBRARY_NAME} SYSTEM PUBLIC ${OCTOMAP_INCLUDE_DIRS})
target_link_libraries(${LIBRARY_NAME} PUBLIC ${OCTOMAP_LIBRARIES}) target_link_libraries(${LIBRARY_NAME} PUBLIC ${OCTOMAP_LIBRARIES})
target_compile_definitions (${LIBRARY_NAME} PUBLIC target_compile_definitions (${LIBRARY_NAME} PUBLIC
-DHPP_FCL_HAVE_OCTOMAP -DHPP_FCL_HAS_OCTOMAP
-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION}
-DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION}
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}) -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
......
...@@ -49,7 +49,7 @@ namespace hpp ...@@ -49,7 +49,7 @@ namespace hpp
namespace fcl namespace fcl
{ {
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
template<typename TypeA, typename TypeB> template<typename TypeA, typename TypeB>
std::size_t Collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, std::size_t Collide(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2,
...@@ -416,7 +416,7 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() ...@@ -416,7 +416,7 @@ CollisionFunctionMatrix::CollisionFunctionMatrix()
collision_matrix[BV_kIOS][BV_kIOS] = &BVHCollide<kIOS>; collision_matrix[BV_kIOS][BV_kIOS] = &BVHCollide<kIOS>;
collision_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHCollide<OBBRSS>; collision_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHCollide<OBBRSS>;
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
collision_matrix[GEOM_OCTREE][GEOM_BOX] = &Collide<OcTree, Box>; collision_matrix[GEOM_OCTREE][GEOM_BOX] = &Collide<OcTree, Box>;
collision_matrix[GEOM_OCTREE][GEOM_SPHERE] = &Collide<OcTree, Sphere>; collision_matrix[GEOM_OCTREE][GEOM_SPHERE] = &Collide<OcTree, Sphere>;
collision_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &Collide<OcTree, Capsule>; collision_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &Collide<OcTree, Capsule>;
......
...@@ -47,7 +47,7 @@ namespace hpp ...@@ -47,7 +47,7 @@ namespace hpp
namespace fcl namespace fcl
{ {
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
template<typename TypeA, typename TypeB> template<typename TypeA, typename TypeB>
FCL_REAL Distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver, FCL_REAL Distance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2, const GJKSolver* nsolver,
...@@ -390,7 +390,7 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() ...@@ -390,7 +390,7 @@ DistanceFunctionMatrix::DistanceFunctionMatrix()
distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS>; distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS>;
distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS>; distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS>;
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
distance_matrix[GEOM_OCTREE][GEOM_BOX] = &Distance<OcTree, Box>; distance_matrix[GEOM_OCTREE][GEOM_BOX] = &Distance<OcTree, Box>;
distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &Distance<OcTree, Sphere>; distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &Distance<OcTree, Sphere>;
distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &Distance<OcTree, Capsule>; distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &Distance<OcTree, Capsule>;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <hpp/fcl/mesh_loader/loader.h> #include <hpp/fcl/mesh_loader/loader.h>
#include <hpp/fcl/mesh_loader/assimp.h> #include <hpp/fcl/mesh_loader/assimp.h>
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
# include <hpp/fcl/octree.h> # include <hpp/fcl/octree.h>
#endif #endif
...@@ -83,7 +83,7 @@ namespace fcl { ...@@ -83,7 +83,7 @@ namespace fcl {
CollisionGeometryPtr_t MeshLoader::loadOctree (const std::string& filename) CollisionGeometryPtr_t MeshLoader::loadOctree (const std::string& filename)
{ {
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
shared_ptr<octomap::OcTree> octree (new octomap::OcTree (filename)); shared_ptr<octomap::OcTree> octree (new octomap::OcTree (filename));
return CollisionGeometryPtr_t (new hpp::fcl::OcTree (octree)); return CollisionGeometryPtr_t (new hpp::fcl::OcTree (octree));
#else #else
......
...@@ -57,9 +57,9 @@ add_fcl_test(bvh_models bvh_models.cpp) ...@@ -57,9 +57,9 @@ add_fcl_test(bvh_models bvh_models.cpp)
add_fcl_test(profiling profiling.cpp) add_fcl_test(profiling profiling.cpp)
add_fcl_test(gjk gjk.cpp) add_fcl_test(gjk gjk.cpp)
if(HPP_FCL_HAVE_OCTOMAP) if(HPP_FCL_HAS_OCTOMAP)
add_fcl_test(octree octree.cpp) add_fcl_test(octree octree.cpp)
endif(HPP_FCL_HAVE_OCTOMAP) endif(HPP_FCL_HAS_OCTOMAP)
## Benchmark ## Benchmark
IF(BUILD_TESTING) IF(BUILD_TESTING)
......
...@@ -216,7 +216,7 @@ void saveOBJFile(const char* filename, std::vector<Vec3f>& points, std::vector<T ...@@ -216,7 +216,7 @@ void saveOBJFile(const char* filename, std::vector<Vec3f>& points, std::vector<T
os.close(); os.close();
} }
#ifdef HPP_FCL_HAVE_OCTOMAP #ifdef HPP_FCL_HAS_OCTOMAP
OcTree loadOctreeFile (const std::string& filename, const FCL_REAL& resolution) OcTree loadOctreeFile (const std::string& filename, const FCL_REAL& resolution)
{ {
OcTreePtr_t octree (new octomap::OcTree (filename)); OcTreePtr_t octree (new octomap::OcTree (filename));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment