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(autoware_behavior_path_planner_common): fix containerOutOfBounds warning #7675

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Jun 25, 2024

Description

This is a fix based on cppcheck containerOutOfBounds error

planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_utils.cpp:481:39: error: Out of bounds access in expression 'base_s.back()' because 'base_s' is empty. [containerOutOfBounds]
  for (double s = eps; s < base_s.back() - eps; s += resample_interval) {
                                      ^
planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_utils.cpp:494:41: error: Out of bounds access in expression 'base_s.back()' because 'base_s' is empty. [containerOutOfBounds]
      end_pose, start_pose, (base_s.back() - new_s.at(i)) / base_s.back());
                                        ^

You know this is a false positive in cppcheck.
This PR is just to avoid cppcheck warnings.

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jun 25, 2024
@veqcc veqcc changed the title fix(autoware_behavior_path_planner_common): fix containerOutOfBounds … fix(autoware_behavior_path_planner_common): fix containerOutOfBounds warning Jun 25, 2024
@veqcc veqcc added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 25, 2024
@veqcc veqcc force-pushed the fix_container_out_of_bounds2 branch from 7f24ea3 to 506aad3 Compare June 25, 2024 04:26
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

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

Project coverage is 13.34%. Comparing base (507e3f4) to head (d819400).
Report is 133 commits behind head on main.

Files Patch % Lines
...avior_path_planner_common/src/utils/path_utils.cpp 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7675      +/-   ##
==========================================
- Coverage   14.84%   13.34%   -1.51%     
==========================================
  Files        1999      525    -1474     
  Lines      139163    49053   -90110     
  Branches    43716    11897   -31819     
==========================================
- Hits        20661     6545   -14116     
+ Misses      95731    41550   -54181     
+ Partials    22771      958   -21813     
Flag Coverage Δ
differential 13.34% <0.00%> (?)
total ?

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

@veqcc veqcc merged commit b91cfa1 into autowarefoundation:main Jun 25, 2024
27 of 30 checks passed
@veqcc veqcc deleted the fix_container_out_of_bounds2 branch June 25, 2024 05:26
simon-eisenmann-driveblocks pushed a commit to simon-eisenmann-driveblocks/autoware.universe that referenced this pull request Jun 26, 2024
…warning (autowarefoundation#7675)

* fix(autoware_behavior_path_planner_common): fix containerOutOfBounds warning

Signed-off-by: Ryuta Kambe <[email protected]>

* fix type

Signed-off-by: Ryuta Kambe <[email protected]>

---------

Signed-off-by: Ryuta Kambe <[email protected]>
Signed-off-by: Simon Eisenmann <[email protected]>
mitukou1109 pushed a commit to mitukou1109/autoware.universe that referenced this pull request Jul 2, 2024
…warning (autowarefoundation#7675)

* fix(autoware_behavior_path_planner_common): fix containerOutOfBounds warning

Signed-off-by: Ryuta Kambe <[email protected]>

* fix type

Signed-off-by: Ryuta Kambe <[email protected]>

---------

Signed-off-by: Ryuta Kambe <[email protected]>
tby-udel pushed a commit to tby-udel/autoware.universe that referenced this pull request Jul 14, 2024
…warning (autowarefoundation#7675)

* fix(autoware_behavior_path_planner_common): fix containerOutOfBounds warning

Signed-off-by: Ryuta Kambe <[email protected]>

* fix type

Signed-off-by: Ryuta Kambe <[email protected]>

---------

Signed-off-by: Ryuta Kambe <[email protected]>
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
…warning (#7675)

* fix(autoware_behavior_path_planner_common): fix containerOutOfBounds warning

Signed-off-by: Ryuta Kambe <[email protected]>

* fix type

Signed-off-by: Ryuta Kambe <[email protected]>

---------

Signed-off-by: Ryuta Kambe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) 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.

2 participants