Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(autoware_pointcloud_preprocessor): reuse collectors to reduce creation of collector and timer #10074
base: main
Are you sure you want to change the base?
feat(autoware_pointcloud_preprocessor): reuse collectors to reduce creation of collector and timer #10074
Changes from 1 commit
2f0ff33
c99f1fe
cbb94ec
81ec941
3375c43
a8444cb
a8b512f
85f75e6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 82 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp#L82
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.
Is this needed? It seems to me reading the RCL source code that the period is unaffected by
cancel()
and so just callingreset()
without re-setting the period should be fine, right?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.
True, thanks for pointing out!
cbb94ec
Check warning on line 90 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp#L90
Check warning on line 109 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp#L109
Check warning on line 114 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp#L114
Check warning on line 118 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp#L118
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.
As discussed with @drwnz just now, it's probably a goof idea to allocate (on startup)
collectors_threshold
collectors and then not add/remove any during operation.This makes it easier to reason about the program state.
(would also get rid of L251-L260)
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!!!
Fixed in 85f75e6
Check notice on line 1 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
ℹ Getting worse: Overall Code Complexity
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.
This can be expressed as a
std::find_if
insteadThere 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! fixed in c99f1fe
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.
Dynamic creation of a new collector may not be ideal. How about we have a fixed number of collectors that are initialized, and then use the first idle one - if none are idle, kick the oldest one and reuse.
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!!!
Fixed in 85f75e6
Check warning on line 262 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
❌ Getting worse: Complex Method
Check notice on line 262 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
ℹ Getting worse: Bumpy Road Ahead
Check warning on line 372 in sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp#L372
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'd like this to be a hard limit. In production, nobody will look at those logs, so the memory footprint could increase forever.
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!
Fixed with resetting collector that has the oldest timestamp:
81ec941 and 3375c43
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.
fix logging: a8444cb