From 20f6e88cc541edc5e7c3ba6e8e7fbca59387df7e Mon Sep 17 00:00:00 2001 From: royjr Date: Tue, 13 Dec 2022 17:59:47 -0500 Subject: [PATCH] delay stopped message to match stock behavior --- selfdrive/car/honda/carcontroller.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 04b98e6f9a..0dbb4126d8 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -117,6 +117,7 @@ class CarController: self.brake_last = 0. self.apply_brake_last = 0 self.last_pump_ts = 0. + self.last_stopping_frame = 0 self.accel = 0.0 self.speed = 0.0 @@ -131,8 +132,17 @@ class CarController: if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: stopping = actuators.longControlState == LongCtrlState.stopping if CC.longActive and stopping: - hud_v_cruise = 252 + if self.last_stopping_frame == 0: + self.last_stopping_frame = self.frame + if self.frame - self.last_stopping_frame > 400: + hud_v_cruise = 252 + else: + 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: + 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: