From 855961f5522d758eca86b75b5cb89bdde85ffd87 Mon Sep 17 00:00:00 2001 From: Jason Wen <47793918+sunnyhaibin@users.noreply.github.com> Date: Wed, 15 Feb 2023 20:33:04 -0500 Subject: [PATCH] Hyundai: 2015-16 Genesis resume from standstill fix (#25579) * Hyundai: 2015-16 Genesis resume from standstill fix * Add comment * Fix typo * Merge both methods * Add back the comment * 20Hz not needed according to tester * no new global state variable * PCM's perspective: random counter -> random counter * only send 5 --------- Co-authored-by: Shane Smiskol old-commit-hash: 90ce7605c159133eaad5ffe6259da513db28e8ff --- selfdrive/car/hyundai/carcontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 516666eff1..1e6f78af20 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -169,7 +169,8 @@ class CarController: if (self.frame - self.last_button_frame) * DT_CTRL > 0.1: # send 25 messages at a time to increases the likelihood of resume being accepted can_sends.extend([hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.RES_ACCEL, self.CP.carFingerprint)] * 25) - self.last_button_frame = self.frame + if (self.frame - self.last_button_frame) * DT_CTRL >= 0.15: + self.last_button_frame = self.frame if self.frame % 2 == 0 and self.CP.openpilotLongitudinalControl: # TODO: unclear if this is needed