Skip to content

fix(velocity_smoother): prevent access when vector is empty #438

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

Conversation

mitukou1109
Copy link
Contributor

@mitukou1109 mitukou1109 commented Apr 24, 2025

Description

This PR fixes velocity_smoother to prevent access to any element in a vector when it's empty.

Related links

Internal: https://star4.slack.com/archives/C0575HP7NJG/p1744865921175659?thread_ts=1744862416.400339&cid=C0575HP7NJG

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Copy link

github-actions bot commented Apr 24, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kosuke55 kosuke55 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 24, 2025
@kosuke55
Copy link
Contributor

@rej55 @satoshi-ota
could you review this PR?

@mitukou1109
Copy link
Contributor Author

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 24.32%. Comparing base (4cb18f5) to head (d4d859e).
Report is 206 commits behind head on main.

Files with missing lines Patch % Lines
...anning/autoware_velocity_smoother/src/resample.cpp 0.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #438       +/-   ##
===========================================
- Coverage   78.75%   24.32%   -54.44%     
===========================================
  Files          11      178      +167     
  Lines         193    11928    +11735     
  Branches       73     3544     +3471     
===========================================
+ Hits          152     2901     +2749     
- Misses         11     8641     +8630     
- Partials       30      386      +356     
Flag Coverage Δ
differential 24.32% <0.00%> (?)
total ?

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: mitukou1109 <mitukou1109@gmail.com>
@kosuke55 kosuke55 force-pushed the fix/velocity-smoother-empty-check branch from f03d7f1 to d4d859e Compare April 24, 2025 12:00
@kosuke55
Copy link
Contributor

@kosuke55 kosuke55 merged commit 94d4490 into autowarefoundation:main Apr 26, 2025
25 of 27 checks passed
@mitukou1109 mitukou1109 deleted the fix/velocity-smoother-empty-check branch April 27, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants