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 logger and clock interfaces from ResourceManager to HardwareComponent interfaces #1585

Closed saikishor closed 2 months ago

saikishor commented 3 months ago

As discussed in the WG meeting on 19th June 2024, I've added the logging and the clock interfaces to ResourceManager and HardwareComponents. I've also modified all the RCUTILS logging to RCLCPP logging.

[INFO] [1719246718.869627728] [resource_manager]: Loading hardware 'MockHardwareSystem' 
[INFO] [1719246718.869987243] [resource_manager]: Loaded hardware 'MockHardwareSystem' from plugin 'mock_components/GenericSystem'
[INFO] [1719246718.870008000] [resource_manager]: Initialize hardware 'MockHardwareSystem' 
[WARN] [1719246718.870122036] [resource_manager.hardware_component.system.MockHardwareSystem]: Custom interface with following offset 'actual_position' does not exist. Offset will not be applied
[INFO] [1719246718.870130775] [resource_manager]: Successful initialization of hardware 'MockHardwareSystem'
[INFO] [1719246718.870288251] [resource_manager]: 'configure' hardware 'MockHardwareSystem' 

Thank you

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 65.48223% with 68 lines in your changes missing coverage. Please review.

Project coverage is 86.96%. Comparing base (bb85eae) to head (9d72500).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1585 +/- ## ========================================== + Coverage 86.94% 86.96% +0.01% ========================================== Files 107 107 Lines 9306 9379 +73 Branches 863 867 +4 ========================================== + Hits 8091 8156 +65 - Misses 899 903 +4 - Partials 316 320 +4 ``` | [Flag](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585/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/1585/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | `86.96% <65.48%> (+0.01%)` | :arrow_up: | 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](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [.../include/controller\_manager/controller\_manager.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=controller_manager%2Finclude%2Fcontroller_manager%2Fcontroller_manager.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL2luY2x1ZGUvY29udHJvbGxlcl9tYW5hZ2VyL2NvbnRyb2xsZXJfbWFuYWdlci5ocHA=) | `100.00% <ø> (ø)` | | | [...er/test/test\_controller\_manager\_with\_namespace.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_controller_manager_with_namespace.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9jb250cm9sbGVyX21hbmFnZXJfd2l0aF9uYW1lc3BhY2UuY3Bw) | `100.00% <100.00%> (+2.94%)` | :arrow_up: | | [...t\_controllers\_chaining\_with\_controller\_manager.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_controllers_chaining_with_controller_manager.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9jb250cm9sbGVyc19jaGFpbmluZ193aXRoX2NvbnRyb2xsZXJfbWFuYWdlci5jcHA=) | `99.14% <100.00%> (+0.28%)` | :arrow_up: | | [...ler\_manager/test/test\_hardware\_management\_srvs.cpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=controller_manager%2Ftest%2Ftest_hardware_management_srvs.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-Y29udHJvbGxlcl9tYW5hZ2VyL3Rlc3QvdGVzdF9oYXJkd2FyZV9tYW5hZ2VtZW50X3NydnMuY3Bw) | `96.02% <100.00%> (-0.06%)` | :arrow_down: | | [...\_interface/include/hardware\_interface/actuator.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Factuator.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL2FjdHVhdG9yLmhwcA==) | `100.00% <ø> (ø)` | | | [.../include/hardware\_interface/actuator\_interface.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Factuator_interface.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL2FjdHVhdG9yX2ludGVyZmFjZS5ocHA=) | `100.00% <100.00%> (ø)` | | | [...re\_interface/include/hardware\_interface/sensor.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Fsensor.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL3NlbnNvci5ocHA=) | `66.66% <ø> (ø)` | | | [...ce/include/hardware\_interface/sensor\_interface.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Fsensor_interface.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL3NlbnNvcl9pbnRlcmZhY2UuaHBw) | `100.00% <100.00%> (ø)` | | | [...re\_interface/include/hardware\_interface/system.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Fsystem.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL3N5c3RlbS5ocHA=) | `100.00% <ø> (ø)` | | | [...ce/include/hardware\_interface/system\_interface.hpp](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree&filepath=hardware_interface%2Finclude%2Fhardware_interface%2Fsystem_interface.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-aGFyZHdhcmVfaW50ZXJmYWNlL2luY2x1ZGUvaGFyZHdhcmVfaW50ZXJmYWNlL3N5c3RlbV9pbnRlcmZhY2UuaHBw) | `100.00% <100.00%> (ø)` | | | ... and [12 more](https://app.codecov.io/gh/ros-controls/ros2_control/pull/1585?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | |
saikishor commented 3 months ago

How can we promote this new feature? Please add something to the release notes, maybe also hardware components docs. Possibly we can use this in the demos as well?

Yes, we can use them in the demos as well. I've used it inside the MockHardwareSystem in this PR.

mergify[bot] commented 3 months ago

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

bmagyar commented 3 months ago

@ahcorde are we allowed one more breaking change please please?