-
Notifications
You must be signed in to change notification settings - Fork 325
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
Add new get_value
API for Handles and Interfaces
#1976
Add new get_value
API for Handles and Interfaces
#1976
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1976 +/- ##
==========================================
- Coverage 89.35% 89.28% -0.07%
==========================================
Files 139 139
Lines 14984 15001 +17
Branches 1286 1286
==========================================
+ Hits 13389 13394 +5
- Misses 1114 1123 +9
- Partials 481 484 +3
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.
Thanks for pushing this forward.
I was thinking of something shorter than 2xget+2xvalue in get().get_value<double>().value()
, but still have no better suggestion.
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.
One thing: Could you please update the release_notes and also add something to the migration notes? We have only a section about the hardware_components there.
Sure I'll do that |
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.
It is not beautiful, but probably we don't have a better way to do this…
Maybe we think of a simpler API in the future. At least we are good with the types.
Maybe the approach from ROS 2 parameters using method get_value_as_double()
is better compared to get_value<double>().value()
?
@bmagyar what do you think?
hardware_interface/include/hardware_interface/loaned_command_interface.hpp
Outdated
Show resolved
Hide resolved
hardware_interface/include/hardware_interface/loaned_command_interface.hpp
Show resolved
Hide resolved
hardware_interface/include/hardware_interface/loaned_state_interface.hpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Dr. Denis <[email protected]>
If we use I have used |
controller_manager/test/test_chainable_controller/test_chainable_controller.cpp
Show resolved
Hide resolved
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.
Minor comment, LGTM.
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'm fine with the new API itself, I'd just add some more documentation. My proposal below.
Am I overseeing something, but it is never documented what returning false actually means? There is no docstring in handle.hpp or loaned_*_interfaces.hpp? Should we also document this in the permanent writing_new_controller page (or where it would belong..)?
(can be in a follow-up PR to avoid to block this being merged)
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 the nice addition to the notes and docstrings. (At latest) When we branch for K-turtle, we should evaluate which parts of the migration notes to include in the permanent docs.
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.
Thank you so much. Let's discuss further on how to improve this but I don't think we should hold back good work.
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!
Related to ros-controls/ros2_controllers#1442 and ros-controls/ros2_controllers#1443
There are still some deprecated warnings in the following ros2_control packages:
transmission_interface: Once this PR is merged. I will perform the changes here : #1845
hardware components: This needs to be handled in a different PR.
I'll take care of both