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_obstacle_stop_planner): fix cppcheck warnings #9388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Nov 19, 2024

Description

Fixed the following cppcheck warnings

planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.hpp:206:10: style: inconclusive: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcThreshDistToForwardObstacle' can be const. [functionConst]
  double calcThreshDistToForwardObstacle(const double current_vel, const double obj_vel);
         ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.cpp:575:34: note: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcThreshDistToForwardObstacle' can be const.
double AdaptiveCruiseController::calcThreshDistToForwardObstacle(
                                 ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.hpp:206:10: note: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcThreshDistToForwardObstacle' can be const.
  double calcThreshDistToForwardObstacle(const double current_vel, const double obj_vel);
         ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.hpp:207:10: style: inconclusive: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcBaseDistToForwardObstacle' can be const. [functionConst]
  double calcBaseDistToForwardObstacle(const double current_vel, const double obj_vel);
         ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.cpp:592:34: note: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcBaseDistToForwardObstacle' can be const.
double AdaptiveCruiseController::calcBaseDistToForwardObstacle(
                                 ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.hpp:207:10: note: Technically the member function 'autoware::motion_planning::AdaptiveCruiseController::calcBaseDistToForwardObstacle' can be const.
  double calcBaseDistToForwardObstacle(const double current_vel, const double obj_vel);
         ^
planning/autoware_obstacle_stop_planner/src/debug_marker.hpp:80:52: performance: Function 'getValues()' should return member 'values_' by const reference. [returnByReference]
  std::array<double, static_cast<int>(TYPE::SIZE)> getValues() const { return values_; }
                                                   ^
planning/autoware_obstacle_stop_planner/src/adaptive_cruise_control.cpp:114:0: style: The function 'sign' is never used. [unusedFunction]
constexpr double sign(const double value)
^

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@veqcc veqcc self-assigned this Nov 19, 2024
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Nov 19, 2024
Copy link

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 Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.76%. Comparing base (5778e01) to head (2b1bc25).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9388      +/-   ##
==========================================
- Coverage   29.77%   29.76%   -0.01%     
==========================================
  Files        1338     1339       +1     
  Lines      103364   103381      +17     
  Branches    40234    40234              
==========================================
+ Hits        30773    30774       +1     
- Misses      69606    69624      +18     
+ Partials     2985     2983       -2     
Flag Coverage Δ *Carryforward flag
differential 8.53% <ø> (?)
total 29.77% <ø> (-0.01%) ⬇️ Carriedforward from 5778e01

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


🚨 Try these New Features:

@veqcc veqcc marked this pull request as ready for review November 19, 2024 12:53
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) 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.

1 participant