Spoof LKAS No-Fault Status

This commit is contained in:
firestar5683
2025-12-18 13:16:41 -06:00
parent b0189d0828
commit 7e403c0ad4
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ static int gm_fwd_hook(int bus_num, int addr) {
// block lkas message and acc messages if gm_cam_long, forward all others
bool is_lkas_msg = (addr == 0x180);
bool is_acc_msg = (addr == 0x315) || (addr == 0x2CB) || (addr == 0x370);
bool block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long);
bool block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long) || (addr == 0x184);
if (!block_msg) {
bus_fwd = 0;
}
+4 -1
View File
@@ -451,7 +451,10 @@ class CarController(CarControllerBase):
if self.CP.networkLocation == NetworkLocation.fwdCamera:
# Silence "Take Steering" alert sent by camera, forward PSCMStatus with HandsOffSWlDetectionStatus=1
if self.frame % 20 == 0:
can_sends.append(gmcan.create_pscm_status(self.packer_pt, CanBus.CAMERA, CS.pscm_status))
pscm_status = CS.pscm_status.copy()
if pscm_status["LKATorqueDeliveredStatus"] == 3:
pscm_status["LKATorqueDeliveredStatus"] = 1
can_sends.append(gmcan.create_pscm_status(self.packer_pt, CanBus.CAMERA, pscm_status))
new_actuators = actuators.as_builder()
new_actuators.accel = accel
+1 -1
View File
@@ -115,7 +115,7 @@ class CarState(CarStateBase):
# 0 inactive, 1 active, 2 temporarily limited, 3 failed
self.lkas_status = pt_cp.vl["PSCMStatus"]["LKATorqueDeliveredStatus"]
ret.steerFaultTemporary = self.lkas_status == 2
ret.steerFaultPermanent = self.lkas_status == 3
ret.steerFaultPermanent = False # self.lkas_status == 3
if self.CP.carFingerprint not in SDGM_CAR:
# 1 - open, 0 - closed
+3
View File
@@ -361,6 +361,9 @@ class CarInterface(CarInterfaceBase):
c.longActive:
events.add(FrogPilotEventName.pedalInterceptorNoBrake)
if self.CS.lkas_status == 3:
events.add(EventName.steerUnavailable)
ret.events = events.to_msg()
return ret, fp_ret