-
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(distortion_corrector_node): replace imu and twist callback with polling subscriber #10057
feat(distortion_corrector_node): replace imu and twist callback with polling subscriber #10057
Conversation
…olling subscriber Changed to read data in bulk using take to reduce subscription callback overhead. Especially effective when the frequency of imu or twist is high, such as 100Hz. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
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 your PR!
I tested with some data and the result looks same as before!
LGTM!
…ith-polling-subscriber
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10057 +/- ##
==========================================
- Coverage 26.98% 26.97% -0.01%
==========================================
Files 1451 1453 +2
Lines 109155 109192 +37
Branches 41944 41956 +12
==========================================
+ Hits 29451 29454 +3
- Misses 76805 76839 +34
Partials 2899 2899
*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.
Thank you for the PR, I checked the code and tested the operation and all LGTM!
Description
Background
The distortion corrector node subscribes to twist and IMU topics using callbacks.
When these topics are published at a high frequency (e.g., 100Hz), the overhead of calling the callback function is significant.
Changed
Replaced the subscription callback function with polling using
take()
.Related links
Private Links:
How was this PR tested?
Test Item 1: Output Unchanged
Verified that the output topics (IMU, twist, and point cloud) remain the same before and after the change using a pytest launch test.
The test script is shown below:
Test Item 2: CPU Usage Improvement
Performance was measured using the perf command. Topics were published using a rosbag.
Measurement commands:
Before change:
After change:
The test results show a significant reduction (approximately 300 times/sec) in context switches due to interrupts, which led to the expected decrease in CPU usage.
Test Item 3: Rosbag Replay Simulator Functionality
Confirmed that the rosbag replay simulator functions as expected.
Notes for reviewers
The queue size for the IMU and twist topics is currently hardcoded for the reason stated in the comment.
Interface changes
None.
Effects on system behavior