RFC: Fixing incorrect loading of parameter files when multiple GazeboControlPlugins are used. #375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I found a bug in
IgnitionROS2ControlPlugin::Configure
that prevents using multiple controller managers with varying parameter files. IMO, this is a pretty important use case for people working on multi-robot simulation.This bug is caused because the parameter file is passed as arguments to
rclcpp::init
:When multiple instances of
IgnitionROS2ControlPlugin
are used, the very first instance callsrclcpp::init
, and sincerclcpp::ok()
is true,rclcpp::init
is not called from the second instance on. Therefore, the global default context only contains the parameters tag of the very first parameter file.I have two possible fixes for this, and would like to get your comment. The first is to use different
rclcpp::Context
for different instances, and then pass the--params <params-file>
as an argument toContext::init
. The second is to use node options.The first gives more separation between controller manager instances, but requires a corresponding fix in controller manager so that controller node instances inherit controller manager's context.
The second shares the same global context, and works without modification if the controller parameter yaml ensures to specify the params_file (even if the same file).
What do you guys think?