-
Notifications
You must be signed in to change notification settings - Fork 569
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
Use std::optional instead of nullptr checking #2454
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2454 +/- ##
==========================================
- Coverage 50.74% 42.98% -7.76%
==========================================
Files 392 692 +300
Lines 32553 56332 +23779
Branches 0 7274 +7274
==========================================
+ Hits 16517 24208 +7691
- Misses 16036 31961 +15925
- Partials 0 163 +163 ☔ View full report in Codecov by Sentry. |
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 tackling this! Something is still not working since the tests are complaining. Can you fix that?
5a31411
to
2274cab
Compare
The build is completing but the tests fail, working on sorting it out. Putting this down for my own reference: |
b3feeba
to
e76aaba
Compare
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.
Most of these pointers are only pointers because they are optional. If we use std::optional, we should switch members to values as long as the API is only exposing references.
I have changed object_types_, robot_state_ and acm_ to values. Can't seem to be making scene_transforms_ into a value successfully, open to suggestions. |
849eb32
to
fba73be
Compare
df17553
to
1da1f39
Compare
471a3f0
to
8b78d98
Compare
6ee2e32
to
b48f557
Compare
This pull request is in conflict. Could you fix it @Shobuj-Paul? |
b48f557
to
db5c5fe
Compare
@sjahr |
594c233
to
fd4037a
Compare
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 this change 👍 Thanks and sorry for the late response
- Still some work left, might be able to make better use of value_or() function
Description
Wrapped scene_transforms_, robot_state_, acm_ and object_types_ in std::optional to handle missing data instead of checking for nullptr.
Fixes #2131
Checklist