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(mpc_lateral_controller): reset ctrl_cmd_prev during manual mode #6541

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@
Trajectory predicted_traj;
Float32MultiArrayStamped debug_values;

if (!m_is_ctrl_cmd_prev_initialized) {
const bool is_under_control = input_data.current_operation_mode.is_autoware_control_enabled &&
input_data.current_operation_mode.mode ==
autoware_adapi_v1_msgs::msg::OperationModeState::AUTONOMOUS;

if (!m_is_ctrl_cmd_prev_initialized || !is_under_control) {

Check warning on line 250 in control/mpc_lateral_controller/src/mpc_lateral_controller.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

MpcLateralController::run increases in cyclomatic complexity from 10 to 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
m_ctrl_cmd_prev = getInitialControlCommand();
m_is_ctrl_cmd_prev_initialized = true;
}
Expand Down
Loading