Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register multiple nodes with single plugin #68

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions behaviortree_ros2/include/behaviortree_ros2/plugins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ namespace BT
constexpr const char* ROS_PLUGIN_SYMBOL = "BT_RegisterRosNodeFromPlugin";
}

/* Use this macro to automatically register one or more custom Nodes
* into a factory that require access to the BT::RosNodeParams.
* For instance:
*
* BT_REGISTER_ROS_NODES(factory, params)
* {
* factory.registerNodeType<SpecialNode>("SpecialNode", params);
* }
*
* IMPORTANT: this function MUST be declared in a cpp file, NOT a header file.
* You must add the definition [BT_PLUGIN_EXPORT] in CMakeLists.txt using:
*
* target_compile_definitions(my_plugin_target PRIVATE BT_PLUGIN_EXPORT )
*/

#define BT_REGISTER_ROS_NODES(factory, params) \
BTCPP_EXPORT void BT_RegisterRosNodeFromPlugin(BT::BehaviorTreeFactory& factory, \
const BT::RosNodeParams& params)

// Use this macro to generate a plugin for:
//
// - BT::RosActionNode
Expand Down
Loading