delay stopped message to match stock behavior

pull/25364/head
royjr 2 years ago
parent c6bcd93d6c
commit 20f6e88cc5
  1. 10
      selfdrive/car/honda/carcontroller.py

@ -117,6 +117,7 @@ class CarController:
self.brake_last = 0. self.brake_last = 0.
self.apply_brake_last = 0 self.apply_brake_last = 0
self.last_pump_ts = 0. self.last_pump_ts = 0.
self.last_stopping_frame = 0
self.accel = 0.0 self.accel = 0.0
self.speed = 0.0 self.speed = 0.0
@ -131,12 +132,21 @@ class CarController:
if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS:
stopping = actuators.longControlState == LongCtrlState.stopping stopping = actuators.longControlState == LongCtrlState.stopping
if CC.longActive and stopping: if CC.longActive and stopping:
if self.last_stopping_frame == 0:
self.last_stopping_frame = self.frame
if self.frame - self.last_stopping_frame > 400:
hud_v_cruise = 252 hud_v_cruise = 252
else: else:
if CS.is_metric: if CS.is_metric:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH if hud_control.speedVisible else 255 hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH if hud_control.speedVisible else 255
else: else:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255 hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255
else:
self.last_stopping_frame = 0
if CS.is_metric:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH if hud_control.speedVisible else 255
else:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255
else: else:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255 hud_v_cruise = hud_control.setSpeed * CV.MS_TO_MPH if hud_control.speedVisible else 255
pcm_cancel_cmd = CC.cruiseControl.cancel pcm_cancel_cmd = CC.cruiseControl.cancel

Loading…
Cancel
Save