mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-29 02:43:47 +08:00
Spoof LKAS No-Fault Status
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user