Skip to content

Commit

Permalink
feat(trajectory_follower): reset previous acceleration when the car s…
Browse files Browse the repository at this point in the history
…tarts moving (tier4#303)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
tkimura4 authored Jan 27, 2022
1 parent 45446dd commit 4c778ba
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,16 @@ LongitudinalController::ControlState LongitudinalController::updateControlState(
if (departure_condition_from_stopping) {
m_pid_vel.reset();
m_lpf_vel_error->reset(0.0);
// prevent the car from taking a long time to start to move
m_prev_ctrl_cmd.acc = std::max(0.0, m_prev_ctrl_cmd.acc);
return ControlState::DRIVE;
}
} else if (current_control_state == ControlState::STOPPED) {
if (departure_condition_from_stopped) {
m_pid_vel.reset();
m_lpf_vel_error->reset(0.0);
// prevent the car from taking a long time to start to move
m_prev_ctrl_cmd.acc = std::max(0.0, m_prev_ctrl_cmd.acc);
return ControlState::DRIVE;
}
} else if (m_control_state == ControlState::EMERGENCY) {
Expand Down

0 comments on commit 4c778ba

Please sign in to comment.