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(interpolation): query key is out of range due to double calculation error #2204

Conversation

takayuki5168
Copy link
Contributor

@takayuki5168 takayuki5168 commented Nov 3, 2022

Description

This range check sometimes fails even in a normal case due to calculation error of double, resulting in the node dying.

if (query_keys.front() < base_keys.front() || base_keys.back() < query_keys.back()) {

To fix this issue, I created this PR.
If the query key's violation from the range of base_keys is epsilon, it is judged as valid and cropped to be inside the range of base_keys.

TIER IV internal link
https://tier4.atlassian.net/browse/T4PB-22737

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: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
@takayuki5168 takayuki5168 changed the title Fix/interpolation slightly out of range fix(interpolation): query key is out of range due to double calculation error Nov 3, 2022
@takayuki5168 takayuki5168 marked this pull request as ready for review November 3, 2022 01:45
@takayuki5168 takayuki5168 requested a review from rej55 as a code owner November 3, 2022 01:45
@takayuki5168 takayuki5168 requested a review from tkimura4 November 3, 2022 01:45
@takayuki5168
Copy link
Contributor Author

takayuki5168 commented Nov 3, 2022

@tkimura4 @rej55 Could you review please.
I confirmed locally that failed scenario passed with this PR

Copy link
Contributor

@tkimura4 tkimura4 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Base: 10.88% // Head: 10.91% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (9b14ac6) compared to base (4c0f75f).
Patch coverage: 69.69% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2204      +/-   ##
==========================================
+ Coverage   10.88%   10.91%   +0.03%     
==========================================
  Files        1179     1179              
  Lines       84935    84970      +35     
  Branches    20043    20075      +32     
==========================================
+ Hits         9242     9272      +30     
+ Misses      65931    65911      -20     
- Partials     9762     9787      +25     
Flag Coverage Δ *Carryforward flag
differential 11.51% <71.42%> (?)
total 10.85% <70.83%> (ø) Carriedforward from 4c0f75f

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

Impacted Files Coverage Δ
...nterpolation/test/src/test_interpolation_utils.cpp 23.43% <33.33%> (+3.02%) ⬆️
...polation/include/interpolation/zero_order_hold.hpp 81.81% <80.00%> (ø)
...tion/include/interpolation/interpolation_utils.hpp 70.00% <87.50%> (+13.33%) ⬆️
common/interpolation/src/linear_interpolation.cpp 62.50% <100.00%> (ø)
...terpolation/src/spherical_linear_interpolation.cpp 64.28% <100.00%> (ø)
common/interpolation/src/spline_interpolation.cpp 59.09% <100.00%> (ø)
system/default_ad_api/src/motion.cpp 13.11% <0.00%> (+11.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

Copy link
Contributor

@rej55 rej55 left a comment

Choose a reason for hiding this comment

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

LGTM

@takayuki5168 takayuki5168 merged commit be5b0dc into autowarefoundation:main Nov 4, 2022
@takayuki5168 takayuki5168 deleted the fix/interpolation-slightly-out-of-range branch November 4, 2022 04:55
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…on error (autowarefoundation#2204)

* fix issue sligtly out of range due to double's calculation error

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update test

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
YoshiRi pushed a commit to YoshiRi/autoware.universe that referenced this pull request Jan 11, 2023
…on error (autowarefoundation#2204)

* fix issue sligtly out of range due to double's calculation error

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update test

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants