Closed marj3220 closed 4 months ago
As pointed out by @MarqRazz:
BT_REGISTER_ROS_NODES(factory, params)
{
BT::RosNodeParams my_params(params);
my_params.default_port_value = "TopicName";
my_params.server_timeout = std::chrono::milliseconds(5000);
factory.registerNodeType<SomeBehavior>("SomeBehavior", my_params);
}
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:
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!