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_run_out_module): initialize accel_reason_ #6982

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented May 11, 2024

Description

This is a fix based on CppCheck warning

planning/behavior_velocity_run_out_module/src/debug.cpp:74:14: warning: Member variable 'RunOutDebug::accel_reason_' is not initialized in the constructor. [uninitMemberVar]
RunOutDebug::RunOutDebug(rclcpp::Node & node) : node_(node)
             ^

As the warning shows, the variable accel_reason_ could be used in publishDebugValue() without being initialized.

I added UNKNOWN to AccelReason enum class, but if you consider somthing better, I would appreciate it.

Tests performed

No

Effects on system behavior

Interface changes

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.

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.

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

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label May 11, 2024
@veqcc veqcc added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label May 11, 2024
Copy link
Contributor

@TomohitoAndo TomohitoAndo left a comment

Choose a reason for hiding this comment

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

LGTM

@veqcc veqcc merged commit f3cd528 into autowarefoundation:main May 13, 2024
31 of 33 checks passed
@veqcc veqcc deleted the fix/uninit_variable_in_behavior_velocity_run_out_module branch May 13, 2024 05:39
vividf pushed a commit to vividf/autoware.universe that referenced this pull request May 16, 2024
…towarefoundation#6982)

fix(behavior_velocity_run_out_module): initialize accel_reason_

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…towarefoundation#6982)

fix(behavior_velocity_run_out_module): initialize accel_reason_

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
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