diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 2955ee7..f8a615a 100755 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -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: diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 202e530..53bfa79 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -1238,7 +1238,7 @@ class Controls: def clearpilot_state_control(self, CC, CS): if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents): # CC.cruiseControl.resume = True - CC.cruiseControl.cancel = True + self.params_memory.put_bool("CPTLkasButtonAction", True) self.params_memory.put_int("SpeedLimitLatDesired", CC.actuators.speed * CV.MS_TO_MPH ) # CC.actuators.speed # print ("Alive") diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index afed40f..35e1a75 100755 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -117,13 +117,11 @@ void update_model(UIState *s, // update path float path; if (paramsMemory.getInt("no_lat_lane_change")) { - path = LANE_CHANGE_NO_LAT_PATH_WIDTH; + path = LANE_CHANGE_NO_LAT_PATH_WIDTH / 20; // Release: better calc for EU users } else { - path = CENTER_LANE_WIDTH; + path = CENTER_LANE_WIDTH / 20; // Release: better calc for EU users } - path = 0.7; - auto lead_count = model.getLeadsV3().size(); if (lead_count > 0) { auto lead_one = model.getLeadsV3()[0];