Skip to content
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

[Handle] Use get_optional instead of get_value<double> #2061

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

After some discussion with @christophfroehlich we thought get_optional might make more sense and explicit compared to get_value<double> and again get its value with .value()

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 89.67742% with 16 lines in your changes missing coverage. Please review.

Project coverage is 89.35%. Comparing base (d126642) to head (8ef56f2).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...terface/include/semantic_components/gps_sensor.hpp 55.17% 5 Missing and 8 partials ⚠️
...nclude/semantic_components/force_torque_sensor.hpp 95.23% 0 Missing and 1 partial ⚠️
...terface/include/semantic_components/imu_sensor.hpp 95.45% 0 Missing and 1 partial ⚠️
...erface/include/semantic_components/pose_sensor.hpp 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2061      +/-   ##
==========================================
- Coverage   89.40%   89.35%   -0.06%     
==========================================
  Files         139      139              
  Lines       14975    14978       +3     
  Branches     1281     1287       +6     
==========================================
- Hits        13389    13383       -6     
+ Misses       1107     1105       -2     
- Partials      479      490      +11     
Flag Coverage Δ
unittests 89.35% <89.67%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
...mantic_components/semantic_component_interface.hpp 90.90% <100.00%> (ø)
...rface/test/test_chainable_controller_interface.cpp 100.00% <ø> (ø)
...chainable_controller/test_chainable_controller.cpp 88.23% <100.00%> (-0.14%) ⬇️
...r_manager/test/test_controller/test_controller.cpp 88.73% <100.00%> (ø)
...t_controllers_chaining_with_controller_manager.cpp 99.25% <100.00%> (ø)
...re_interface/include/hardware_interface/handle.hpp 81.81% <100.00%> (+1.29%) ⬆️
...de/hardware_interface/loaned_command_interface.hpp 60.00% <100.00%> (+7.50%) ⬆️
...lude/hardware_interface/loaned_state_interface.hpp 60.00% <100.00%> (ø)
...rface/test/mock_components/test_generic_system.cpp 99.72% <ø> (ø)
...dware_interface/test/test_component_interfaces.cpp 97.63% <100.00%> (-0.06%) ⬇️
... and 8 more

... and 3 files with indirect coverage changes

@saikishor saikishor requested a review from destogl February 19, 2025 22:58
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like.

If we don't merge this, we should apply the changes from f958dfe also to the master.

@Juliaj
Copy link

Juliaj commented Feb 20, 2025

@saikishor @christophfroehlich , just for my knowledge, could you provide some context and outline a few discussion points ? 🙇

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Feb 20, 2025

see #2055 and #1976, we were not really happy with the API but hadn't a better idea.

@christophfroehlich
Copy link
Contributor

and here the origin of the API discussions
ros-controls/ros2_controllers#1442
ros-controls/ros2_controllers#1467
ros-controls/ros2_controllers#1443

@christophfroehlich
Copy link
Contributor

basically,
get().get_optional().value() instead of get().get_value<double>().value() in controller and hardware components 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants