ros2_control icon indicating copy to clipboard operation
ros2_control copied to clipboard

Remove `autodeclare` of parameters for controllers. #behavior-breaking

Open destogl opened this issue 3 years ago • 3 comments
trafficstars

destogl avatar Jul 02 '22 20:07 destogl

Codecov Report

Merging #757 (8d3fff9) into master (925f5f3) will decrease coverage by 1.57%. The diff coverage is 38.29%.

@@            Coverage Diff             @@
##           master     #757      +/-   ##
==========================================
- Coverage   34.61%   33.04%   -1.58%     
==========================================
  Files          52       88      +36     
  Lines        2981     8526    +5545     
  Branches     1855     5689    +3834     
==========================================
+ Hits         1032     2817    +1785     
- Misses        310      647     +337     
- Partials     1639     5062    +3423     
Flag Coverage Δ
unittests 33.04% <38.29%> (-1.58%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
controller_manager/src/ros2_control_node.cpp 0.00% <0.00%> (ø)
..._interface/include/hardware_interface/actuator.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/sensor.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/system.hpp 100.00% <ø> (ø)
hardware_interface/src/sensor.cpp 50.52% <ø> (ø)
hardware_interface/src/system.cpp 55.45% <ø> (ø)
...rface/test/fake_components/test_generic_system.cpp 8.60% <ø> (ø)
...dware_interface/test/test_component_interfaces.cpp 33.26% <ø> (+5.08%) :arrow_up:
hardware_interface/test/test_component_parser.cpp 8.52% <ø> (-3.13%) :arrow_down:
...e_interface/test/test_components/test_actuator.cpp 51.72% <ø> (+6.00%) :arrow_up:
... and 108 more

codecov-commenter avatar Jul 02 '22 20:07 codecov-commenter

Did you mean to remove both?

  • .allow_undeclared_parameters(true)
  • .automatically_declare_parameters_from_overrides(true)

bmagyar avatar Jul 02 '22 22:07 bmagyar

Did you mean to remove both?

* .allow_undeclared_parameters(true)

* .automatically_declare_parameters_from_overrides(true)

yes.

destogl avatar Jul 04 '22 18:07 destogl

Since the ros2 iron release, the modification caused the change in value of allow_undeclared_parameters and automatically_declare_parameters_from_overrides of all controllers (e.g. including custom controllers, ros2_controllers, joint trajectory controller, etc). And it seems there is no method for a controller to set them back to true since it is built into controller manager ((https://github.com/ros-controls/ros2_control/blob/master/controller_manager/src/controller_manager.cpp#L1156).

More info: https://github.com/ros2/rclcpp/issues/2264

Should it be reverted back? Or is it possible to allow controller_interface to have node option of their own for flexibility?

KKSTB avatar Aug 08 '23 03:08 KKSTB

Can you explain a bit more your use case, why it is not possible to declare parameters?

destogl avatar Aug 09 '23 17:08 destogl

I understand the reason of the breaking change now after coming across this release note: https://docs.ros.org/en/rolling/Releases/Release-Dashing-Diademata.html

Besides I found that in case old parameter behavior is still needed, the custom controller_interface can override the controller_interface_base::init() function, discard the const node_option input parameter and create another one of their own (because of const), set their node_option and pass it to super class controller_interface_base::init().

Yet I think it is preferred to adapt to the breaking change instead.

KKSTB avatar Aug 10 '23 01:08 KKSTB