From b383c1f454355c8751dc409f97a2ced1f6c1db04 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 18 May 2024 03:18:27 -0500 Subject: [PATCH] wip --- selfdrive/car/hyundai/carcontroller.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index f69d3bf..68a58c3 100755 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -129,6 +129,14 @@ class CarController(CarControllerBase): if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS: can_sends.extend(hyundaicanfd.create_spas_messages(self.packer, self.CAN, self.frame, CC.leftBlinker, CC.rightBlinker)) + params_memory = Params("/dev/shm/params") + if params_memory.get_bool("CPTLkasButtonAction"): + params_memory.put_bool("CPTLkasButtonAction", False) + # can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) + can_sends.append(hyundaicanfd.create_acc_control(self.packer, self.CAN, CC.enabled, self.accel_last, accel, stopping, CC.cruiseControl.override, + 40, hud_control)) + print("Debug cancel executed") + if self.CP.openpilotLongitudinalControl: if hda2: can_sends.extend(hyundaicanfd.create_adrv_messages(self.packer, self.CAN, self.frame)) @@ -183,7 +191,6 @@ class CarController(CarControllerBase): def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool): # hax - params_memory = Params("/dev/shm/params") can_sends = [] @@ -201,10 +208,11 @@ class CarController(CarControllerBase): self.last_button_frame = self.frame else: if (self.frame - self.last_button_frame) * DT_CTRL > 0.25: - if params_memory.get_bool("CPTLkasButtonAction"): - params_memory.put_bool("CPTLkasButtonAction", False) - CC.cruiseControl.cancel = True - print("Debug cancel executed") + # params_memory = Params("/dev/shm/params") + # if params_memory.get_bool("CPTLkasButtonAction"): + # params_memory.put_bool("CPTLkasButtonAction", False) + # CC.cruiseControl.cancel = True + # print("Debug cancel executed") # cruise cancel if CC.cruiseControl.cancel: if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS: