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:

View File

@@ -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")

View File

@@ -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];