Skip to content

Commit

Permalink
split ClassLoader plugin code from main libraries
Browse files Browse the repository at this point in the history
to work around ros/class_loader#131
and have all code using the `CurrentState` stage sanitize correctly
(unless they use it through ClassLoader).
  • Loading branch information
v4hn committed May 28, 2021
1 parent ff4eb4e commit 949024f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ catkin_package(
LIBRARIES
${PROJECT_NAME}
${PROJECT_NAME}_stages
${PROJECT_NAME}_stage_plugins
INCLUDE_DIRS
include
CATKIN_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion core/motion_planning_stages_plugin_description.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<library path="libmoveit_task_constructor_core_stages">
<library path="libmoveit_task_constructor_core_stage_plugins">
<class name="moveit_task_constructor/Current State"
type="moveit::task_constructor::stages::CurrentState"
base_class_type="moveit::task_constructor::Stage">
Expand Down
7 changes: 6 additions & 1 deletion core/src/stages/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ add_library(${PROJECT_NAME}_stages
)
target_link_libraries(${PROJECT_NAME}_stages ${PROJECT_NAME} ${catkin_LIBRARIES})

install(TARGETS ${PROJECT_NAME}_stages
add_library(${PROJECT_NAME}_stage_plugins
plugins.cpp
)
target_link_libraries(${PROJECT_NAME}_stage_plugins ${PROJECT_NAME}_stages ${catkin_LIBRARIES})

install(TARGETS ${PROJECT_NAME}_stages ${PROJECT_NAME}_stage_plugins
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
4 changes: 0 additions & 4 deletions core/src/stages/current_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,3 @@ void CurrentState::compute() {
} // namespace stages
} // namespace task_constructor
} // namespace moveit

/// register plugin
#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(moveit::task_constructor::stages::CurrentState, moveit::task_constructor::Stage)
7 changes: 7 additions & 0 deletions core/src/stages/plugins.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <moveit/task_constructor/stages/current_state.h>

#include <pluginlib/class_list_macros.h>

/// register plugins to use with ClassLoader

PLUGINLIB_EXPORT_CLASS(moveit::task_constructor::stages::CurrentState, moveit::task_constructor::Stage)

0 comments on commit 949024f

Please sign in to comment.