[Spawner] Allow arguments per controller instead of global args#2895
[Spawner] Allow arguments per controller instead of global args#2895bmagyar merged 11 commits intoros-controls:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2895 +/- ##
==========================================
- Coverage 89.40% 89.27% -0.14%
==========================================
Files 157 158 +1
Lines 18781 19155 +374
Branches 1510 1549 +39
==========================================
+ Hits 16791 17100 +309
- Misses 1369 1417 +48
- Partials 621 638 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
This pull request is in conflict. Could you fix it @saikishor? |
christophfroehlich
left a comment
There was a problem hiding this comment.
I think this is a great idea.
I tested this successfully with ros-controls/ros2_control_demos#1030 and have some notes with possible improvements:
- How can we add a hint to the --controller argument from
ros2 run controller_manager spawner --help? - does it make sense/would it be possible to give more than one controller with one --controller option "block", see the two pid controllers in the linked example which have identical settings.
|
@saikishor @christophfroehlich I've implemented the --controller hint using a dummy arg. The other version was to use an epilogue thing from argparse which would look weird in the user output. Tests keep things working even though the current thing is a liiiiiiiiiiittle hacky but it works nicely. I think we should merge the PR as-is |
LGTM. Thanks |
(cherry picked from commit cb9a983)
(cherry picked from commit cb9a983)
This PR adds some changes to the Spawner to allow it to define the controller args per controller rather than global args for all the controllers.
I've added a new function in the launch_utils and I tested it using the following changes in example_12
https://github.com/ros-controls/ros2_control_demos/blob/advanced_spawner/example_12/bringup/launch/rrbot.launch.py
With this change we can do both the following
ros2 run controller_manager spawner ctrl_1 ctrl_2 --inactive --controller-ros-args ....and
ros2 run controller_manager spawner --controller ctrl_1 --load-only --controller ctrl_2 --inactive --controller-ros-args ...