ros-controls / ros2_control

Generic and simple controls framework for ROS 2
https://control.ros.org
Apache License 2.0
479 stars 293 forks source link

Add controller node options args to be able to set controller specific node arguments #1713

Open saikishor opened 1 month ago

saikishor commented 1 month ago

A different approach of #1712

    robot_controller_spawner = Node(
        package="controller_manager",
        executable="spawner",
        arguments=["diffbot_base_controller", "--param-file", controller_config, "--controller-ros-args", '--ros-args -r /diffbot_base_controller/cmd_vel:=/cmd_vel'],
    )

Fixes: #1711 Fixes: #1714

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 78.78788% with 7 lines in your changes missing coverage. Please review.

Project coverage is 86.72%. Comparing base (84e85f9) to head (d92deda).

Files with missing lines Patch % Lines
controller_manager/src/controller_manager.cpp 80.00% 1 Missing and 2 partials :warning:
controller_manager/controller_manager/spawner.py 50.00% 1 Missing and 1 partial :warning:
...r_manager/test/test_controller/test_controller.cpp 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1713 +/- ## ========================================== - Coverage 86.79% 86.72% -0.07% ========================================== Files 116 116 Lines 10715 10749 +34 Branches 981 986 +5 ========================================== + Hits 9300 9322 +22 - Misses 1062 1068 +6 - Partials 353 359 +6 ``` | [Flag](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | `86.72% <78.78%> (-0.07%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [...r\_manager/test/test\_controller/test\_controller.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_controller%2Ftest_controller.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9jb250cm9sbGVyL3Rlc3RfY29udHJvbGxlci5ocHA=) | `100.00% <ø> (ø)` | | | [controller\_manager/test/test\_spawner\_unspawner.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_spawner_unspawner.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9zcGF3bmVyX3Vuc3Bhd25lci5jcHA=) | `99.22% <100.00%> (+0.03%)` | :arrow_up: | | [controller\_manager/controller\_manager/spawner.py](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?src=pr&el=tree&filepath=controller_manager%2Fcontroller_manager%2Fspawner.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL2NvbnRyb2xsZXJfbWFuYWdlci9zcGF3bmVyLnB5) | `70.31% <50.00%> (-0.66%)` | :arrow_down: | | [...r\_manager/test/test\_controller/test\_controller.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_controller%2Ftest_controller.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9jb250cm9sbGVyL3Rlc3RfY29udHJvbGxlci5jcHA=) | `91.48% <50.00%> (-3.86%)` | :arrow_down: | | [controller\_manager/src/controller\_manager.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713?src=pr&el=tree&filepath=controller_manager%2Fsrc%2Fcontroller_manager.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3NyYy9jb250cm9sbGVyX21hbmFnZXIuY3Bw) | `77.26% <80.00%> (-0.22%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1713/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls)
mergify[bot] commented 1 month ago

This pull request is in conflict. Could you fix it @saikishor?

saikishor commented 3 weeks ago

I like, but needs some tests for it and advertisement in the release notes. We could also think of deprecating the "old way" #1712

Tested successfully with ros-controls/ros2_control_demos#577

@christophfroehlich I've added the tests for this case and the release_notes.

Thank you!