ros2_control
ros2_control copied to clipboard
Remove `autodeclare` of parameters for controllers. #behavior-breaking
Codecov Report
Merging #757 (8d3fff9) into master (925f5f3) will decrease coverage by
1.57%. The diff coverage is38.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 |
Did you mean to remove both?
- .allow_undeclared_parameters(true)
- .automatically_declare_parameters_from_overrides(true)
Did you mean to remove both?
* .allow_undeclared_parameters(true) * .automatically_declare_parameters_from_overrides(true)
yes.
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?
Can you explain a bit more your use case, why it is not possible to declare parameters?
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.