From 37cab10a89ed991df321536bff315883cf15dd4a Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Tue, 24 Sep 2019 18:24:19 -0500 Subject: [PATCH 1/2] Write file on installation that allows tesseract_collision plugins to be found by ROS2 packages --- tesseract/tesseract_collision/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tesseract/tesseract_collision/CMakeLists.txt b/tesseract/tesseract_collision/CMakeLists.txt index ecb89ec26d7..27666b79eb4 100644 --- a/tesseract/tesseract_collision/CMakeLists.txt +++ b/tesseract/tesseract_collision/CMakeLists.txt @@ -114,6 +114,8 @@ install(DIRECTORY include/${PROJECT_NAME} install(FILES package.xml DESTINATION share/${PROJECT_NAME}) +file(WRITE ${CMAKE_INSTALL_PREFIX}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") + # Create cmake config files include(CMakePackageConfigHelpers) configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/${PROJECT_NAME}-config.cmake.in From 1aa819442a4f6d0073f9118b49d1c837eba05d5d Mon Sep 17 00:00:00 2001 From: Joseph Schornak Date: Wed, 25 Sep 2019 13:22:05 -0500 Subject: [PATCH 2/2] Add an explanatory comment to CMakeLists.txt --- tesseract/tesseract_collision/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tesseract/tesseract_collision/CMakeLists.txt b/tesseract/tesseract_collision/CMakeLists.txt index 27666b79eb4..3b33286e67d 100644 --- a/tesseract/tesseract_collision/CMakeLists.txt +++ b/tesseract/tesseract_collision/CMakeLists.txt @@ -114,6 +114,9 @@ install(DIRECTORY include/${PROJECT_NAME} install(FILES package.xml DESTINATION share/${PROJECT_NAME}) +# Create an ament_index resource file to allow ROS2 ament_index_cpp to locate the installed path to this package. +# This is a workaround to let the ROS2 version of pluginlib find tesseract_collision's plugins, since tesseract_collision is a non-ROS CMake package. +# ADDITIONAL REQUIREMENT: The installed path must be added to the AMENT_PREFIX_PATH environment variable at runtime, which is outside the scope of CMakeLists.txt. file(WRITE ${CMAKE_INSTALL_PREFIX}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") # Create cmake config files