From f3834c56ca297edfd418c59607d20609d9b47a0e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 12 Aug 2024 14:47:56 -0400 Subject: [PATCH] a lead instead --- selfdrive/controls/controlsd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index baa4783a3d..c35ab69ae0 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -644,10 +644,8 @@ class Controls: self.LoC.reset() if not self.joystick_mode: - speeds = long_plan.speeds - resume = False - if len(speeds): - resume = self.enabled_long and CS.standstill and speeds[-1] > 0.1 and self.CP.carName == "hyundai" + a_lead = self.sm['radarState'].leadOne.aLeadK + resume = self.enabled_long and CS.standstill and a_lead > 0.1 and self.CP.carName == "hyundai" # accel PID loop pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_helper.v_cruise_kph * CV.KPH_TO_MS)