Skip to content

Commit 89dbbb7

Browse files
authored
Export plugins to share directory & register CrossDoor plugin (#804)
1 parent 2a8a226 commit 89dbbb7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

sample_nodes/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,15 @@ target_link_libraries(movebase_node_dyn PRIVATE ${BTCPP_LIBRARY})
3333
target_compile_definitions(movebase_node_dyn PRIVATE BT_PLUGIN_EXPORT )
3434
set_target_properties(movebase_node_dyn PROPERTIES LIBRARY_OUTPUT_DIRECTORY
3535
${BTCPP_BIN_DESTINATION} )
36+
37+
######################################################
38+
# INSTALL plugins for other packages to load
39+
40+
INSTALL(TARGETS
41+
crossdoor_nodes_dyn
42+
dummy_nodes_dyn
43+
movebase_node_dyn
44+
LIBRARY DESTINATION share/${PROJECT_NAME}/bt_plugins
45+
ARCHIVE DESTINATION share/${PROJECT_NAME}/bt_plugins
46+
RUNTIME DESTINATION share/${PROJECT_NAME}/bt_plugins
47+
)

sample_nodes/crossdoor_nodes.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,11 @@ void CrossDoor::reset()
7474
_door_locked = true;
7575
_pick_attempts = 0;
7676
}
77+
78+
// This function must be implemented in the .cpp file to create
79+
// a plugin that can be loaded at run-time
80+
BT_REGISTER_NODES(factory)
81+
{
82+
static CrossDoor cross_door;
83+
cross_door.registerNodes(factory);
84+
}

0 commit comments

Comments
 (0)