-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Refactor/observation buffer #4890
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
base: main
Are you sure you want to change the base?
Conversation
observation_list_.erase(std::next(observation_list_.begin()), observation_list_.end()); | ||
} else { | ||
// otherwise remove all observations that are older then the keep time | ||
observation_list_.remove_if([now = clock_->now(), this](const auto observation){ |
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.
The previous implementation was assuming that the observation_list_
was ordered, but I think that is not guaranteed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
A couple of quick remarks before a full review:
This code is 1:1 from ROS 1, so I don't doubt there's performance optimizations to be made and happy to review it. I'd just like to understand what the benefits are while reviewing it |
@kfabian any update? |
Signed-off-by: Fabian König <[email protected]>
4bcbe31
to
b6f1873
Compare
…when queried Signed-off-by: Fabian König <[email protected]>
b6f1873
to
3bc462b
Compare
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Description of how this change was tested
Future work that may be required in bullet points
lock
andunlock
member functions. In my opinion this error prone, the ObservationBuffer should either be thread safe on its own (by not exposing the mutex, but locking it in the implementation when needed) or it should not have the mutex member at all and the calling code would be responsible.For Maintainers: