Skip to content

Commit eaf0d10

Browse files
authored
feat(vehicle_cmd_gate): improve transition filter for longitudinal (#4334)
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
1 parent 37cbd8d commit eaf0d10

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

control/vehicle_cmd_gate/src/vehicle_cmd_gate.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -529,15 +529,15 @@ AckermannControlCommand VehicleCmdGate::filterControlCommand(const AckermannCont
529529
// switching from manual to autonomous
530530
auto prev_values = (mode.mode == OperationModeState::AUTONOMOUS) ? out : current_status_cmd;
531531

532+
if (ego_is_stopped) {
533+
prev_values.longitudinal = out.longitudinal;
534+
}
535+
532536
// TODO(Horibe): To prevent sudden acceleration/deceleration when switching from manual to
533537
// autonomous, the filter should be applied for actual speed and acceleration during manual
534538
// driving. However, this means that the output command from Gate will always be close to the
535-
// driving state during manual driving. Since the Gate's output is checked by various modules as
536-
// the intended value of Autoware, it should be closed to planned values. Conversely, it is
537-
// undesirable for the target vehicle speed to be non-zero in a situation where the vehicle is
538-
// supposed to stop. Until the appropriate handling will be done, previous value is used for the
539-
// filter in manual mode.
540-
prev_values.longitudinal = out.longitudinal; // TODO(Horibe): to be removed
539+
// driving state during manual driving. Here, let autoware publish the stop command when the ego
540+
// is stopped to intend the autoware is trying to keep stopping.
541541

542542
filter_.setPrevCmd(prev_values);
543543
filter_on_transition_.setPrevCmd(prev_values);

0 commit comments

Comments
 (0)