This commit is contained in:
Your Name
2024-05-18 02:58:28 -05:00
parent 69165b456a
commit 691036b9b9
3 changed files with 13 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ from openpilot.selfdrive.car.hyundai import hyundaicanfd, hyundaican
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
from openpilot.selfdrive.car.interfaces import CarControllerBase
from openpilot.common.params import Params
VisualAlert = car.CarControl.HUDControl.VisualAlert
LongCtrlState = car.CarControl.Actuators.LongControlState
@@ -182,10 +182,18 @@ class CarController(CarControllerBase):
return new_actuators, can_sends
def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool):
# hax
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")
can_sends = []
if use_clu11:
if CC.cruiseControl.cancel:
print("Cancel executed")
print("Yes")
can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP))
CS.lkas_trigger_result = 5
elif CC.cruiseControl.resume: