diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bdb9b4973134dc5ca1284075880ebcfd690a1c5..92bc01b593479f6a38e90b1c1a6a65d1781e10e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # # Software License Agreement (BSD License) # -# Copyright (c) 2014 CNRS-LAAS +# Copyright (c) 2014-2019 CNRS-LAAS, INRIA # Author: Florent Lamiraux, Joseph Mirabel # All rights reserved. # @@ -45,6 +45,11 @@ SET(PROJECT_USE_CMAKE_EXPORT TRUE) CMAKE_POLICY(SET CMP0022 NEW) SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE) +# Check if the submodule cmake have been initialized +IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake") + MESSAGE(FATAL_ERROR "\nPlease run the following command first:\ngit submodule update --init\n") +ENDIF() + include(cmake/eigen.cmake) include(cmake/boost.cmake) include(cmake/python.cmake) diff --git a/README.md b/README.md index 6641511a9ea4e6e0dcff1f764f8b7e9cfbc68029..e8c4a3a76477e7ff52c173fe27f959e57fabf883 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ -## FCL -- The Flexible Collision Library +HPP-FCL — An extension of the Flexible Collision Library +======= [](https://travis-ci.org/humanoid-path-planner/hpp-fcl) [](https://gepgitlab.laas.fr/humanoid-path-planner/hpp-fcl/commits/master) [](http://projects.laas.fr/gepetto/doc/humanoid-path-planner/hpp-fcl/master/coverage/) -This project is a fork from https://github.com/flexible-collision-library/fcl. - -The main differences are. +This project is initially a fork from https://github.com/flexible-collision-library/fcl and has evolved since then. +The main new features are: - the use of a safety margin when detecting collision, - the computation of a lower bound of the distance between two objects when collision checking is performed and no collision is found. +- the implementation of Python bindings for easy code prototyping. +- the fix of various bugs. + +This project is now used in many robotics frameworks such as [Pinocchio](https://github.com/stack-of-tasks/pinocchio), an open-source software which implements efficient and versatile rigid body dynamics algorithms and the [Humanoid Path Planner](https://humanoid-path-planner.github.io/hpp-doc), an open-source software for Motion and Manipulation Planning. + +## Acknowledgments + +The development of **HPP-FCL** is actively supported by the [Gepetto team](http://projects.laas.fr/gepetto/) [@LAAS-CNRS](http://www.laas.fr) diff --git a/cmake b/cmake index 8e87406799ea10cfeb90a56f84f3e1ef9c049753..308d3c947a3e276b06c5fa79894119346635de4d 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 8e87406799ea10cfeb90a56f84f3e1ef9c049753 +Subproject commit 308d3c947a3e276b06c5fa79894119346635de4d diff --git a/package.xml b/package.xml new file mode 100644 index 0000000000000000000000000000000000000000..48e1826f11347f7ec879f4e1aa8f792e65f1de72 --- /dev/null +++ b/package.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<package format="2"> + <name>hpp-fcl</name> + <version>1.2.0</version> + <description>An extension of the Flexible Collision Library.</description> + <!-- The maintainer listed here is for the ROS release to receive emails for the buildfarm. + Please check the repository URL for full list of authors and maintainers. --> + <maintainer email="jmirabel@laas.fr">Joseph Mirabel</maintainer> + <maintainer email="justin.carpentier@inria.fr">Justin Carpentier</maintainer> + <maintainer email="wolfgang.merkt@ed.ac.uk">Wolfgang Merkt</maintainer> + <license>BSD</license> + + <url type="website">https://github.com/humanoid-path-planner/hpp-fcl</url> + + <build_depend>git</build_depend> + <build_depend>doxygen</build_depend> + <doc_depend>doxygen</doc_depend> + <depend>python</depend> + <depend>python-numpy</depend> + <depend>eigen</depend> + <depend>boost</depend> + <depend>assimp</depend> + <depend>octomap</depend> + <depend>eigenpy</depend> + + <buildtool_depend>cmake</buildtool_depend> + <export> + <build_type>cmake</build_type> + </export> +</package> diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6204ed7178324a16ea1e713ceb107c3d0d8ce153..cfccdedc2ac8aa3a5c5d3ed221cfd55eaaa4a487 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -47,9 +47,8 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED distance.cc fcl.cc) -TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME}) -TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES}) -TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME}) +TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC) +TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${BOOST_system_LIBRARY}) PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigenpy) SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cbf9dd398ad5f98cce8adaaade82b72075501ae3..4a5ac568ef71ad2693aee5b20f254e7788e20a77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,19 +82,28 @@ set(${LIBRARY_NAME}_SOURCES mesh_loader/loader.cpp ) -link_directories(${Boost_LIBRARY_DIRS}) - add_library(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ) -TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES}) -target_include_directories(${LIBRARY_NAME} SYSTEM PUBLIC +TARGET_LINK_LIBRARIES(${LIBRARY_NAME} + PUBLIC + Boost::thread + Boost::date_time + Boost::system + ) + +target_include_directories(${LIBRARY_NAME} + SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ) +target_include_directories(${LIBRARY_NAME} + PUBLIC + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> +) + PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} assimp) if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150") target_compile_definitions(${LIBRARY_NAME} PRIVATE -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) @@ -111,8 +120,6 @@ IF(OCTOMAP_FOUND) -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}) ENDIF(OCTOMAP_FOUND) -target_include_directories(${LIBRARY_NAME} PUBLIC - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) install(TARGETS ${LIBRARY_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b9308e3bbba1f72dfc4c3066cb5f6d953d414bb9..982b06c4ffccd5bb79782d85408de339e3d8aec7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,18 +1,12 @@ config_files(fcl_resources/config.h) -macro(add_fcl_template_test test_name) - add_executable(${ARGV}) - target_link_libraries(${test_name} - ${Boost_LIBRARIES} - ) - add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name}) -endmacro(add_fcl_template_test) - macro(add_fcl_test test_name) add_executable(${ARGV}) target_link_libraries(${test_name} - hpp-fcl + PUBLIC + ${PROJECT_NAME} ${Boost_LIBRARIES} + Boost::unit_test_framework utility ) PKG_CONFIG_USE_DEPENDENCY(${test_name} assimp) @@ -26,7 +20,7 @@ IF(RUN_TESTS) ELSE() add_library(utility STATIC EXCLUDE_FROM_ALL utility.cpp) ENDIF() -target_link_libraries(utility hpp-fcl) +target_link_libraries(utility PUBLIC ${PROJECT_NAME}) add_fcl_test(math math.cpp) @@ -60,7 +54,13 @@ endif(HPP_FCL_HAVE_OCTOMAP) ## Benchmark add_executable(test-benchmark benchmark.cpp) -target_link_libraries(test-benchmark hpp-fcl ${Boost_LIBRARIES} utility) +target_link_libraries(test-benchmark + PUBLIC + utility + Boost::chrono + Boost::filesystem + ${PROJECT_NAME} + ) ## Python tests IF(BUILD_PYTHON_INTERFACE)