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(probabilistic_occupancy_grid_map): fix shadowVariable #7942

Merged

Conversation

kobayu858
Copy link
Contributor

Description

This is a fix based on cppcheck shadowVariable warnings

probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp:218:22: style: Local variable 'source' shadows outer variable [shadowVariable]
        const auto & source = obstacle_pointcloud_angle_bin.at(dist_index);
                     ^

probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_projective.cpp:278:22: style: Local variable 'source' shadows outer variable [shadowVariable]
        const auto & source = obstacle_pointcloud_angle_bin.at(dist_index);
                     ^

Using range-based for loop.

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kobayu858 kobayu858 requested a review from veqcc July 10, 2024 09:08
@kobayu858 kobayu858 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 10, 2024
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 28.76%. Comparing base (6b9f164) to head (5c0f1a2).
Report is 27 commits behind head on main.

Files Patch % Lines
...p/lib/costmap_2d/occupancy_grid_map_projective.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7942      +/-   ##
==========================================
+ Coverage   28.75%   28.76%   +0.01%     
==========================================
  Files        1594     1594              
  Lines      116894   116850      -44     
  Branches    50048    50051       +3     
==========================================
+ Hits        33615    33616       +1     
+ Misses      74154    74137      -17     
+ Partials     9125     9097      -28     
Flag Coverage Δ *Carryforward flag
differential 10.05% <50.00%> (?)
total 28.76% <ø> (+0.01%) ⬆️ Carriedforward from 70860e0

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

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

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
@kobayu858 kobayu858 requested a review from yukkysaito July 11, 2024 01:08
Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
@kobayu858 kobayu858 requested a review from yukkysaito July 11, 2024 06:56
Copy link
Contributor

@yukkysaito yukkysaito left a comment

Choose a reason for hiding this comment

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

LGTM

@kobayu858 kobayu858 merged commit 9aedc68 into autowarefoundation:main Jul 11, 2024
30 checks passed
@kobayu858 kobayu858 deleted the fix/cppcheck_shadowVariable_per-10 branch July 12, 2024 07:07
Ariiees pushed a commit to Ariiees/autoware.universe that referenced this pull request Jul 22, 2024
…undation#7942)

* fix:shadowVariable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* refactor: use range-based for loop

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* style: rename variable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* style: rename variable

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

---------

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (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.

3 participants