Skip to content

Commit

Permalink
Merge pull request #1370 from BryceStevenWilley/fcl_plugin
Browse files Browse the repository at this point in the history
Fcl as a Plugin
  • Loading branch information
jrgnicho committed Mar 7, 2019
2 parents d411fe3 + 81ed3cb commit 7bd2ea6
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
9 changes: 8 additions & 1 deletion moveit_core/collision_detection_fcl/CMakeLists.txt
Expand Up @@ -10,12 +10,19 @@ set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_V
target_link_libraries(${MOVEIT_LIB_NAME} moveit_collision_detection ${catkin_LIBRARIES} ${urdfdom_LIBRARIES} ${urdfdom_headers_LIBRARIES} ${LIBFCL_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(${MOVEIT_LIB_NAME} ${catkin_EXPORTED_TARGETS})

install(TARGETS ${MOVEIT_LIB_NAME}
add_library(collision_detector_fcl_plugin src/collision_detector_fcl_plugin_loader.cpp)
set_target_properties(collision_detector_fcl_plugin PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(collision_detector_fcl_plugin ${catkin_LIBRARIES} ${MOVEIT_LIB_NAME})


install(TARGETS ${MOVEIT_LIB_NAME} collision_detector_fcl_plugin
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})

install(FILES ../collision_detector_fcl_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

if(CATKIN_ENABLE_TESTING)
find_package(moveit_resources REQUIRED)
include_directories(${moveit_resources_INCLUDE_DIRS})
Expand Down
@@ -0,0 +1,19 @@
/*
* collision_detector_fcl_plugin_loader.h
*/

#ifndef MOVEIT_COLLISION_DETECTION_FCL_COLLISION_DETECTOR_FCL_PLUGIN_LOADER_H_
#define MOVEIT_COLLISION_DETECTION_FCL_COLLISION_DETECTOR_FCL_PLUGIN_LOADER_H_

#include <moveit/collision_detection/collision_plugin.h>
#include <moveit/collision_detection_fcl/collision_detector_allocator_fcl.h>

namespace collision_detection
{
class CollisionDetectorFCLPluginLoader : public CollisionPlugin
{
public:
virtual bool initialize(const planning_scene::PlanningScenePtr& scene, bool exclusive) const;
};
}
#endif // MOVEIT_COLLISION_DETECTION_FCL_COLLISION_DETECTOR_FCL_PLUGIN_LOADER_H_
@@ -0,0 +1,13 @@
#include <moveit/collision_detection_fcl/collision_detector_fcl_plugin_loader.h>
#include <pluginlib/class_list_macros.h>

namespace collision_detection
{
bool CollisionDetectorFCLPluginLoader::initialize(const planning_scene::PlanningScenePtr& scene, bool exclusive) const
{
scene->setActiveCollisionDetector(CollisionDetectorAllocatorFCL::create(), exclusive);
return true;
}
}

PLUGINLIB_EXPORT_CLASS(collision_detection::CollisionDetectorFCLPluginLoader, collision_detection::CollisionPlugin)
8 changes: 8 additions & 0 deletions moveit_core/collision_detector_fcl_description.xml
@@ -0,0 +1,8 @@
<library path="lib/libcollision_detector_fcl_plugin">
<class name="FCL" type="collision_detection::CollisionDetectorFCLPluginLoader"
base_class_type="collision_detection::CollisionPlugin">
<description>
FCL Collision Detector, default for MoveIt.
</description>
</class>
</library>
4 changes: 4 additions & 0 deletions moveit_core/package.xml
Expand Up @@ -54,4 +54,8 @@
<test_depend>orocos_kdl</test_depend>
<test_depend>rosunit</test_depend>
<test_depend>code_coverage</test_depend>

<export>
<moveit_core plugin="${prefix}/collision_detector_fcl_description.xml"/>
</export>
</package>

0 comments on commit 7bd2ea6

Please sign in to comment.