wip
This commit is contained in:
@@ -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.hyundaicanfd import CanBus
|
||||||
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
|
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
|
||||||
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
||||||
|
from openpilot.common.params import Params
|
||||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||||
LongCtrlState = car.CarControl.Actuators.LongControlState
|
LongCtrlState = car.CarControl.Actuators.LongControlState
|
||||||
|
|
||||||
@@ -182,10 +182,18 @@ class CarController(CarControllerBase):
|
|||||||
return new_actuators, can_sends
|
return new_actuators, can_sends
|
||||||
|
|
||||||
def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool):
|
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 = []
|
can_sends = []
|
||||||
if use_clu11:
|
if use_clu11:
|
||||||
if CC.cruiseControl.cancel:
|
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))
|
can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP))
|
||||||
CS.lkas_trigger_result = 5
|
CS.lkas_trigger_result = 5
|
||||||
elif CC.cruiseControl.resume:
|
elif CC.cruiseControl.resume:
|
||||||
|
|||||||
@@ -1238,7 +1238,7 @@ class Controls:
|
|||||||
def clearpilot_state_control(self, CC, CS):
|
def clearpilot_state_control(self, CC, CS):
|
||||||
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
||||||
# CC.cruiseControl.resume = True
|
# 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 )
|
self.params_memory.put_int("SpeedLimitLatDesired", CC.actuators.speed * CV.MS_TO_MPH )
|
||||||
# CC.actuators.speed
|
# CC.actuators.speed
|
||||||
# print ("Alive")
|
# print ("Alive")
|
||||||
|
|||||||
@@ -117,13 +117,11 @@ void update_model(UIState *s,
|
|||||||
// update path
|
// update path
|
||||||
float path;
|
float path;
|
||||||
if (paramsMemory.getInt("no_lat_lane_change")) {
|
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 {
|
} 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();
|
auto lead_count = model.getLeadsV3().size();
|
||||||
if (lead_count > 0) {
|
if (lead_count > 0) {
|
||||||
auto lead_one = model.getLeadsV3()[0];
|
auto lead_one = model.getLeadsV3()[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user