-
Notifications
You must be signed in to change notification settings - Fork 337
[Handle] Use get_optional
instead of get_value<double>
#2061
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2061 +/- ##
==========================================
- Coverage 89.56% 89.46% -0.10%
==========================================
Files 139 139
Lines 15009 15013 +4
Branches 1278 1284 +6
==========================================
- Hits 13443 13432 -11
- Misses 1088 1092 +4
- Partials 478 489 +11
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.
I like.
If we don't merge this, we should apply the changes from f958dfe also to the master.
@saikishor @christophfroehlich , just for my knowledge, could you provide some context and outline a few discussion points ? 🙇 |
and here the origin of the API discussions |
basically, |
What do you think about adding |
@Wiktor-99 Very good question :) I initially thought the same thing, but upon further thinking it didn't make sense to me because in most of the use cases, you cannot assume any default value for the state or the command contextually it won't make any sense. For instance, to obtain the position or the velocity of a joint, you cannot assume any default value and proceed with the code. Doing so might cause the control law of the controller unstable in some cases. For that reason, I didn't prefer to do it this way. |
Yeah, I see your point in most cases there is no good default value, nevertheless I see few places where you did return some kind of default (semantic components), but I don't see better way. I'll think about it. |
e7457a7
into
ros-controls:master
After some discussion with @christophfroehlich we thought
get_optional
might make more sense and explicit compared toget_value<double>
and again get its value with.value()