Closed
Description
TL:DR How can the default_port_value of a ROS2 BT Node be set when using the new plugin architecture?
Context
Normally a ROS2 BT node would be set this way:
// in main()
BehaviorTreeFactory factory;
auto node = std::make_shared<rclcpp::Node>("fibonacci_action_client");
// provide the ROS node and the name of the action service
RosNodeParams params;
params.nh = node;
params.default_port_value = "fibonacci";
factory.registerNodeType<FibonacciAction>("Fibonacci", params);
Problem when using macro from BT.CPP:
Using the bt_factory.h (BT.CPP) for creating a non-ROS plugin is straightforward, but when adding ROS2 necessities the ROS node goes out of scope.
Code:
Result:
Problem when using macro from BT.ROS2:
Inversly, when using the plugins.hpp (BT.ROS2) macro, I can't find how to set the params:
Code:
Result:
So how should a ROS2 plugin be set with its params?
Thank you in advance!
Metadata
Metadata
Assignees
Labels
No labels