Skip to content

Commit

Permalink
Made FCL a Plugin, so we can actually switch between checkers now.
Browse files Browse the repository at this point in the history
  • Loading branch information
BryceStevenWilley committed Mar 2, 2019
1 parent 822a991 commit d8a9337
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
7 changes: 6 additions & 1 deletion moveit_core/collision_detection_fcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ 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})

Expand Down
Original file line number Diff line number Diff line change
@@ -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_
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 d8a9337

Please sign in to comment.