-
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
fix(behavior_velocity_planner): int/uint for path index #2221
fix(behavior_velocity_planner): int/uint for path index #2221
Conversation
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@soblin |
@@ -93,7 +93,8 @@ std::optional<std::pair<size_t, size_t>> findLaneIdInterval( | |||
break; | |||
} | |||
} | |||
start = std::max<size_t>(0, start - 1); // the idx of last point before the interval | |||
start = static_cast<size_t>( | |||
std::max<int>(0, static_cast<int>(start) - 1)); // the idx of last point before the interval |
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.
how about this? To get rid of many casting.
start = start > 0 ? start - 1 : 0;
Signed-off-by: Mamoru Sobue <mamoru.sobue@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.
Confirmed the issue was solved.
Codecov ReportBase: 11.09% // Head: 11.09% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #2221 +/- ##
=======================================
Coverage 11.09% 11.09%
=======================================
Files 1202 1202
Lines 86198 86198
Branches 20706 20707 +1
=======================================
Hits 9564 9564
Misses 66542 66542
Partials 10092 10092
*This pull request uses carry forward flags. Click here to find out more.
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. |
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
…dation#2221) * fixed int/uint for path index Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> * reflected comments Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
…dation#2221) * fixed int/uint for path index Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> * reflected comments Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
…dation#2221) * fixed int/uint for path index Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> * reflected comments Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
…dation#2221) * fixed int/uint for path index Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> * reflected comments Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp> Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Signed-off-by: Mamoru Sobue mamoru.sobue@tier4.jp
Description
Fixed overflow of uint.
Related links
#2190
Tests performed
Fixed error in scenario test
Notes for reviewers
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.
After all checkboxes are checked, anyone who has write access can merge the PR.