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_pure_pursuit): fix redundantInitialization redundantInitialization #8225

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Jul 26, 2024

Description

This is a fix based on cppcheck redundantInitialization and variableScope warnings

control/autoware_pure_pursuit/src/autoware_pure_pursuit/autoware_pure_pursuit_lateral_controller.cpp:455:24: style: Redundant initialization for 'lookahead_distance'. The initialized value is overwritten before it is read. [redundantInitialization]
    lookahead_distance = calcLookaheadDistance(
                       ^
control/autoware_pure_pursuit/src/autoware_pure_pursuit/autoware_pure_pursuit_lateral_controller.cpp:453:29: note: lookahead_distance is initialized
  double lookahead_distance = min_lookahead_distance;
                            ^
control/autoware_pure_pursuit/src/autoware_pure_pursuit/autoware_pure_pursuit_lateral_controller.cpp:455:24: note: lookahead_distance is overwritten
    lookahead_distance = calcLookaheadDistance(
                       ^
control/autoware_pure_pursuit/src/autoware_pure_pursuit_core/interpolate.cpp:116:10: style: The scope of the variable 'tmp' can be reduced. [variableScope]
  double tmp;
         ^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

…ialization

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Jul 26, 2024
@veqcc veqcc self-assigned this Jul 26, 2024
Copy link

github-actions bot commented Jul 26, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@veqcc veqcc added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 26, 2024
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

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

Project coverage is 29.24%. Comparing base (7fe1e36) to head (960fbc3).
Report is 65 commits behind head on main.

Files Patch % Lines
...rsuit/autoware_pure_pursuit_lateral_controller.cpp 0.00% 2 Missing ⚠️
...uit/src/autoware_pure_pursuit_core/interpolate.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8225      +/-   ##
==========================================
- Coverage   29.25%   29.24%   -0.01%     
==========================================
  Files        1600     1600              
  Lines      117736   117752      +16     
  Branches    50713    50716       +3     
==========================================
+ Hits        34438    34439       +1     
- Misses      74098    74112      +14     
- Partials     9200     9201       +1     
Flag Coverage Δ *Carryforward flag
differential 15.54% <0.00%> (?)
total 29.25% <ø> (+<0.01%) ⬆️ Carriedforward from ba5a81a

*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.

@veqcc veqcc merged commit 2adb6f8 into autowarefoundation:main Aug 2, 2024
30 checks passed
@veqcc veqcc deleted the fix/redundantInitialization branch August 2, 2024 05:35
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Aug 5, 2024
…ialization (autowarefoundation#8225)

* fix(autoware_pure_pursuit): fix redundantInitialization redundantInitialization

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

* Update control/autoware_pure_pursuit/src/autoware_pure_pursuit_core/interpolate.cpp

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Takayuki Murooka <takayuki5168@gmail.com>
esteve pushed a commit to esteve/autoware.universe that referenced this pull request Aug 13, 2024
…ialization (autowarefoundation#8225)

* fix(autoware_pure_pursuit): fix redundantInitialization redundantInitialization

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

* Update control/autoware_pure_pursuit/src/autoware_pure_pursuit_core/interpolate.cpp

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Takayuki Murooka <takayuki5168@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) tag: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