Skip to content

Commit

Permalink
Enable Bullet and fix plugin configuration (#489)
Browse files Browse the repository at this point in the history
Co-authored-by: Henning Kayser <[email protected]>
  • Loading branch information
jrgnicho and henningkayser authored Jun 28, 2021
1 parent 4a210bc commit b1d1de4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
17 changes: 7 additions & 10 deletions moveit_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ include(ConfigExtras.cmake)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")

# TODO: Move collision detection into separate packages
find_package(Bullet 2.87 REQUIRED)

find_package(PkgConfig REQUIRED)
Expand Down Expand Up @@ -61,7 +60,7 @@ set(THIS_PACKAGE_INCLUDE_DIRS
backtrace/include
collision_detection/include
collision_detection_fcl/include
${BULLET_INC}
collision_detection_bullet/include
constraint_samplers/include
controller_manager/include
distance_field/include
Expand Down Expand Up @@ -97,7 +96,7 @@ set(THIS_PACKAGE_LIBRARIES
moveit_planning_interface
moveit_collision_detection
moveit_collision_detection_fcl
${BULLET_LIB}
moveit_collision_detection_bullet
moveit_kinematic_constraints
moveit_planning_scene
moveit_constraint_samplers
Expand Down Expand Up @@ -134,13 +133,14 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
Eigen3
eigen3_cmake_module
OCTOMAP
${BULLET_ENABLE}
Bullet
)

pluginlib_export_plugin_description_file(moveit_core collision_detector_fcl_description.xml)
pluginlib_export_plugin_description_file(moveit_core collision_detector_bullet_description.xml)

include_directories(SYSTEM ${EIGEN3_INCLUDE_DIRS}
${LIBFCL_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
)

include_directories(${THIS_PACKAGE_INCLUDE_DIRS}
Expand Down Expand Up @@ -182,12 +182,9 @@ add_subdirectory(distance_field)
add_subdirectory(collision_distance_field)
add_subdirectory(kinematics_metrics)
add_subdirectory(dynamics_solver)
# TODO(henningkayser): enable bullet once the library is migrated to ROS2
if(BULLET_ENABLE)
add_subdirectory(collision_detection_bullet)
else()
install(FILES collision_detection_bullet/empty_description.xml DESTINATION share/${PROJECT_NAME} RENAME collision_detector_bullet_description.xml)
endif()

pluginlib_export_plugin_description_file(moveit_core collision_detector_bullet_description.xml)

# TODO: Port python bindings
# add_subdirectory(python)
Expand Down
16 changes: 9 additions & 7 deletions moveit_core/collision_detection_bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(MOVEIT_LIB_NAME moveit_collision_detection_bullet)

add_library(${MOVEIT_LIB_NAME}
add_library(${MOVEIT_LIB_NAME} SHARED
src/bullet_integration/bullet_utils.cpp
src/bullet_integration/bullet_discrete_bvh_manager.cpp
src/bullet_integration/bullet_cast_bvh_manager.cpp
Expand All @@ -10,7 +10,9 @@ add_library(${MOVEIT_LIB_NAME}
src/bullet_integration/ros_bullet_utils.cpp
)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")

ament_target_dependencies(${MOVEIT_LIB_NAME} SYSTEM
BULLET
)
ament_target_dependencies(${MOVEIT_LIB_NAME}
rclcpp
rmw_implementation
Expand All @@ -22,11 +24,13 @@ ament_target_dependencies(${MOVEIT_LIB_NAME}
)
target_link_libraries(${MOVEIT_LIB_NAME}
moveit_collision_detection
${BULLET_LIBRARIES}
)

add_library(collision_detector_bullet_plugin src/collision_detector_bullet_plugin_loader.cpp)
add_library(collision_detector_bullet_plugin SHARED src/collision_detector_bullet_plugin_loader.cpp)
set_target_properties(collision_detector_bullet_plugin PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
ament_target_dependencies(collision_detector_bullet_plugin SYSTEM
BULLET
)
ament_target_dependencies(collision_detector_bullet_plugin
rclcpp
urdf
Expand All @@ -39,15 +43,13 @@ target_link_libraries(collision_detector_bullet_plugin
moveit_planning_scene
)

install(DIRECTORY include/ DESTINATION include)
install(TARGETS ${MOVEIT_LIB_NAME} EXPORT ${MOVEIT_LIB_NAME}
TARGETS collision_detector_bullet_plugin EXPORT collision_detector_bullet_plugin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
install(DIRECTORY include/ DESTINATION include)

install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})

if(BUILD_TESTING)
if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion moveit_core/collision_detector_bullet_description.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<library path="lib/libcollision_detector_bt_plugin">
<library path="collision_detector_bullet_plugin">
<class name="Bullet" type="collision_detection::CollisionDetectorBtPluginLoader"
base_class_type="collision_detection::CollisionPlugin">
<description>
Expand Down

0 comments on commit b1d1de4

Please sign in to comment.