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(behavior_velocity_planner): int/uint for path index #2221

Merged

Conversation

soblin
Copy link
Contributor

@soblin soblin commented Nov 7, 2022

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@taikitanaka3
Copy link
Contributor

@soblin
I think you also want end index guard for overflow too.
image

@taikitanaka3 taikitanaka3 changed the title fixed int/uint for path index fix(behavior_velocity_planner): int/uint for path index Nov 7, 2022
@@ -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
Copy link
Contributor

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>
@TakaHoribe TakaHoribe self-requested a review November 7, 2022 04:20
Copy link
Contributor

@TakaHoribe TakaHoribe left a 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.

@TakaHoribe TakaHoribe enabled auto-merge (squash) November 7, 2022 04:21
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Base: 11.09% // Head: 11.09% // No change to project coverage 👍

Coverage data is based on head (caecff8) compared to base (f7bc465).
Patch coverage: 0.00% of modified lines in pull request are covered.

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           
Flag Coverage Δ *Carryforward flag
differential 4.23% <0.00%> (?)
total 11.06% <0.00%> (ø) Carriedforward from f7bc465

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

Impacted Files Coverage Δ
...ity_planner/src/scene_module/intersection/util.cpp 0.00% <0.00%> (ø)

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

@taikitanaka3 taikitanaka3 left a comment

Choose a reason for hiding this comment

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

LGTM

@TakaHoribe TakaHoribe merged commit 976d5c8 into autowarefoundation:main Nov 7, 2022
@soblin soblin deleted the fix/perf/intersection-2190 branch November 7, 2022 05:21
soblin added a commit to tier4/autoware.universe that referenced this pull request Nov 22, 2022
…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>
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…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>
soblin added a commit to soblin/autoware.universe that referenced this pull request Dec 22, 2022
…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>
YoshiRi pushed a commit to YoshiRi/autoware.universe that referenced this pull request Jan 11, 2023
…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>
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