-
Notifications
You must be signed in to change notification settings - Fork 682
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
feat(autoware_pointcloud_preprocessor): reuse collectors to reduce creation of collector and timer #10074
Conversation
Signed-off-by: vividf <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10074 +/- ##
==========================================
- Coverage 26.77% 26.76% -0.01%
==========================================
Files 1416 1416
Lines 108468 108503 +35
Branches 41719 41730 +11
==========================================
Hits 29039 29039
- Misses 76552 76587 +35
Partials 2877 2877
*This pull request uses carry forward flags. Click here to find out more. ☔ 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.
LGTM in codespace, but I did not check with any rosbags.
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.
Good stuff!
I've left a few comments in places I think could be simplified or where I'd like the more safety guarantees.
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Outdated
Show resolved
Hide resolved
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
Outdated
Show resolved
Hide resolved
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/cloud_collector.cpp
Outdated
Show resolved
Hide resolved
...include/autoware/pointcloud_preprocessor/concatenate_data/concatenate_and_time_sync_node.hpp
Outdated
Show resolved
Hide resolved
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: vividf <[email protected]>
Signed-off-by: vividf <[email protected]>
Signed-off-by: vividf <[email protected]>
Signed-off-by: vividf <[email protected]>
Signed-off-by: vividf <[email protected]>
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.
Probably hard-coding number of collectors to 2 or 3 would be okay. I don't see a use case with more collectors at the moment.
Also would allow us to allocate all of them once on startup instead of dynamically.
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Show resolved
Hide resolved
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: vividf <[email protected]>
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: vividf <[email protected]>
Signed-off-by: vividf <[email protected]>
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.
Please see the minor grammar comment, otherwise LGTM.
...ing/autoware_pointcloud_preprocessor/src/concatenate_data/concatenate_and_time_sync_node.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: vividf <[email protected]>
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've finally gotten around to test it! I used some gen1 taxi data and copied its concat parameters from one of our projects.
Looking good I think!
One question that might as well be me not understanding how to configure concat:
When deliberately messing up the params for one LiDAR, I would (intuitively) expect that there isn't a huge drop in concat output frequency, but rather that a group is dropped only sometimes, or every second time, etc.
I think this might be because we are always killing the oldest group, never giving it a chance to finish. It might also be because my timeouts are so long that almost all waiting collectors will be cleared because the inputs come at 10Hz.
Let me know your thoughts 🙇
Naive mode
small-compressed-naive.webm
Advanced mode, correct params
small-compressed-advanced_correct.webm
Advanced mode, incorrect params
small-compressed-advanced_incorrect.webm
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.
After talking offline, it is clear that a user can always misconfigure concat enough to look like the bottom video - that's the user's fault, but the algorithm itself seems to work fine 👍
LGTM
Description
#8300 introduces a collector and initializes a timer in each collector with a 100 ms interval, which leads to infinite object creation and deletion.
This PR reuses collectors that are no longer in use (i.e., those that have completed concatenation) by resetting their timers, effectively converting them into new collectors. This approach helps limit unnecessary collector creation and timer initialization.
Related links
Parent Issue:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.