Skip to content
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

fix(motion_utils): check if the buffer is empty #3883

Merged

Conversation

TomohitoAndo
Copy link
Contributor

@TomohitoAndo TomohitoAndo commented Jun 1, 2023

Description

In the current implementation, node will die if the data that has old timestamp is passed to the VehicleStopChecker.
This can happen when traffic load increases and message subscribe is delayed.

This is the same issue as this PR.

Tests performed

I added the test and confirmed the program will not die.

Before the change

$ ./build/motion_utils/test_motion_utils --gtest_filter="vehicle_stop_checker*"
Note: Google Test filter = vehicle_stop_checker*
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from vehicle_stop_checker
[ RUN      ] vehicle_stop_checker.isVehicleStopped
fish: Job 1, './build/motion_utils/test_motio…' terminated by signal SIGSEGV (Address boundary error)

After the change

$ ./build/motion_utils/test_motion_utils --gtest_filter="vehicle_stop_checker*"
Note: Google Test filter = vehicle_stop_checker*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from vehicle_stop_checker
[ RUN      ] vehicle_stop_checker.isVehicleStopped
[       OK ] vehicle_stop_checker.isVehicleStopped (3044 ms)
[----------] 1 test from vehicle_stop_checker (3044 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (3044 ms total)
[  PASSED  ] 1 test.

Effects on system behavior

Not applicable.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
@github-actions github-actions bot added the component:common Common packages from the autoware-common repository. (auto-assigned) label Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Patch coverage: 25.00% and project coverage change: +0.27 🎉

Comparison is base (27fa619) 13.80% compared to head (5869ac9) 14.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3883      +/-   ##
==========================================
+ Coverage   13.80%   14.08%   +0.27%     
==========================================
  Files        1391     1523     +132     
  Lines       97408   116829   +19421     
  Branches    28829    36790    +7961     
==========================================
+ Hits        13451    16456    +3005     
- Misses      69501    83299   +13798     
- Partials    14456    17074    +2618     
Flag Coverage Δ *Carryforward flag
differential 18.31% <25.00%> (?)
total 13.80% <ø> (ø) Carriedforward from 27fa619

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...ls/test/src/vehicle/test_vehicle_state_checker.cpp 18.80% <22.58%> (+0.53%) ⬆️
...motion_utils/src/vehicle/vehicle_state_checker.cpp 73.58% <100.00%> (+2.43%) ⬆️

... and 252 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@satoshi-ota satoshi-ota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomohitoAndo TomohitoAndo merged commit 9bb2695 into autowarefoundation:main Jun 2, 2023
@TomohitoAndo TomohitoAndo deleted the fix-vehicle-state-checker branch June 2, 2023 07:13
TomohitoAndo added a commit to tier4/autoware.universe that referenced this pull request Jun 2, 2023
)

* fix(motion_utils): check if the buffer is empty

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>

* add test to check if the old data is discarded

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>

---------

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
TomohitoAndo added a commit to tier4/autoware.universe that referenced this pull request Jun 2, 2023
) (#553)

* fix(motion_utils): check if the buffer is empty



* add test to check if the old data is discarded



---------

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
s-azumi pushed a commit to s-azumi/autoware.universe that referenced this pull request Jul 13, 2023
)

* fix(motion_utils): check if the buffer is empty

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>

* add test to check if the old data is discarded

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>

---------

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
taikitanaka3 pushed a commit that referenced this pull request Jul 14, 2023
fix(motion_utils): check if the buffer is empty (#3883)

* fix(motion_utils): check if the buffer is empty



* add test to check if the old data is discarded



---------

Signed-off-by: Tomohito Ando <tomohito.ando@tier4.jp>
Co-authored-by: Tomohito ANDO <tomohito.ando@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants