-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix controller parameter loading issue in different cases #1293
Fix controller parameter loading issue in different cases #1293
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1293 +/- ##
==========================================
- Coverage 47.87% 47.68% -0.19%
==========================================
Files 41 41
Lines 3453 3477 +24
Branches 1878 1896 +18
==========================================
+ Hits 1653 1658 +5
- Misses 444 453 +9
- Partials 1356 1366 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me :)
Does it make a difference now if the ParamListener of GPL is created in the |
Thanks for bringing it up. Nope, it doesn't make any difference at all. You can have it created anywhere in |
Co-authored-by: Christoph Fröhlich <[email protected]>
Hi, I've reverted ros-controls/ros2_controllers#967 locally and backported the main functionality of this PR to humble (I needed to adapt it) in order to test it and it works for me. It solves ros-controls/ros2_controllers#966. |
fine. do we have a favorite in doing it in on_init or on_configure? Not sure if it is implemented in the same way with all controllers. |
@christophfroehlich I would favor the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally agree with this, but I would suggest that we don't backport this but create separate PRs for humble
and rolling
. This one would be for humble
and the breaking one for rolling
.
Oh and BTW, don't we already have something like PIMPL, where controllers have only on_init
. In that case, we should make init
not overridable from now on, i.e., it should not be virtual. In this case, we don't break user API, but only internal one.
hardware_interface/include/hardware_interface/controller_info.hpp
Outdated
Show resolved
Hide resolved
can you open PR please with this revert and write there that it should be merged when we have this functionality added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than the refactor request
604c0eb
Lately, we have had reports about issues with loading parameters by parsing the param file to the spawners. This didn't work sometimes because we were trying to initialize the GPL library in the init. When it tries to declare and get the parameters, as they are not available, it throws an exception as the validation sometimes fails (as in ros-controls/ros2_controllers#698 and ros-controls/ros2_controllers#795) (or) that we couldn't also use the
read_only
parameters in this case, and they need to exist upon the LifeCycleNode creation (ros-controls/ros2_controllers#966).Upon taking a close look at the documentation, I think we can use the following approach to be able to properly set the parameters to the Node.
The following approach can be backported, however, in some cases that the controllers needs to override their
NodeOptions
for their particular use-case (as in some tests), this won't work as the default argument from the controller_interface_base.hpp will be overridden by the CM now. Inorder to properly fix this, we will need a part of this PR : #1169Fixes: #1311
Fixes: ros-controls/ros2_controllers#966
Closes: ros-controls/ros2_controllers#795
Closes: PickNikRobotics/generate_parameter_library#156