Skip to content

Commit

Permalink
reset ctrl_cmd_prev during manual mode
Browse files Browse the repository at this point in the history
Signed-off-by: kyoichi-sugahara <[email protected]>
  • Loading branch information
kyoichi-sugahara committed Mar 5, 2024
1 parent 59f7031 commit 89b7b9c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ trajectory_follower::LateralOutput MpcLateralController::run(
Trajectory predicted_traj;
Float32MultiArrayStamped debug_values;

if (!m_is_ctrl_cmd_prev_initialized) {
if (
!m_is_ctrl_cmd_prev_initialized ||
!input_data.current_operation_mode.is_autoware_control_enabled) {

Check notice on line 248 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 11, 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

0 comments on commit 89b7b9c

Please sign in to comment.