Skip to content

Commit

Permalink
fix(mpc_lateral_controller): reset ctrl_cmd_prev during manual mode (#…
Browse files Browse the repository at this point in the history
…6541)

* reset ctrl_cmd_prev during manual mode

Signed-off-by: kyoichi-sugahara <[email protected]>

* fix manual driving condition

Signed-off-by: kyoichi-sugahara <[email protected]>

---------

Signed-off-by: kyoichi-sugahara <[email protected]>
  • Loading branch information
kyoichi-sugahara authored Mar 5, 2024
1 parent 7ef61a9 commit 48d20f1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ trajectory_follower::LateralOutput MpcLateralController::run(
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) {
m_ctrl_cmd_prev = getInitialControlCommand();
m_is_ctrl_cmd_prev_initialized = true;
}
Expand Down

0 comments on commit 48d20f1

Please sign in to comment.