byd: spoof 508 steering feedback to camera on SEAL — fixes ADAS lockout
The Seal's camera faults (ACC + ADAS + AEB warning lights, 'unable to activate ADAS') because panda neutralizes its intercepted 790 LKAS commands while the camera watches the 508 feedback for execution — seeing its requests ignored, it disables the whole ADAS suite. The Han avoids this by echoing the camera's request back in the 792 feedback; the Seal needs the same on its 508 STEERING_TORQUE_ANGLE: - bydcan.create_steering_torque_angle: mirrors the Han spoof logic on the 508 layout — when camera LKAS is active, echo its 790 torque request into MAIN_TORQUE and its 482 angle request into TARGET_ANGLE with Cruise_Activated=1; prepare -> LKSPrepare=1; passive -> neutral - carcontroller: Seal sends the 508 spoof, Han keeps the 792 spoof - carstate: capture the camera's 482 angle command for the spoof - panda: whitelist 508 TX on bus 2 (absolute-limit check), stock 508 blocked 0->2 via check_relay — one config covers both platforms - firmware rebuilt; spoof decode-verified (camera's exact torque+angle echoed back); 120 safety tests + MISRA clean NOTE: the ADAS fault latches — the car needs a full power cycle (or a few minutes off) after flashing this build for the dash warnings to clear.
This commit is contained in:
1 parent
63e9aa6cc1
commit
02f1972e99
23 files changed
+81
-21
No files matched your search
@@ -30,10 +30,10 @@ class CarController(CarControllerBase):
|
||||
|
||||
self.apply_accel_last = 0
|
||||
|
||||
# EPS steering feedback forwarding (792 STEERING_TORQUE) only applies to
|
||||
# platforms whose EPS reports on 792 (HAN). The SEAL EPS reports on
|
||||
# 508 STEERING_TORQUE_ANGLE which is forwarded stock for now.
|
||||
self.send_steering_feedback = CP.carFingerprint != CAR.BYD_SEAL_PERFORMANCE_25
|
||||
# EPS steering feedback is spoofed towards the camera on both platforms so
|
||||
# the stock ADAS does not fault while its LKAS commands are intercepted:
|
||||
# HAN uses 792 STEERING_TORQUE, SEAL uses 508 STEERING_TORQUE_ANGLE.
|
||||
self.seal_platform = CP.carFingerprint == CAR.BYD_SEAL_PERFORMANCE_25
|
||||
|
||||
def update(self, CC, CC_SP, CS, now_nanos):
|
||||
# car control running in 100Hz
|
||||
@@ -80,12 +80,18 @@ class CarController(CarControllerBase):
|
||||
lkas_request_prepare, lkas_active,
|
||||
lkas_mode, CS.eps_activated)
|
||||
can_sends.append(pack)
|
||||
if self.send_steering_feedback:
|
||||
if self.seal_platform:
|
||||
pack = self.can.create_steering_torque_angle(CS.eps_steering_torque_msg,
|
||||
CS.mpc_lkas_output,
|
||||
CS.mpc_lkas_request_prepare,
|
||||
CS.mpc_lkas_active,
|
||||
CS.mpc_lkas_angle_output)
|
||||
else:
|
||||
pack = self.can.create_steering_torque(CS.eps_steering_torque_msg,
|
||||
CS.mpc_lkas_output,
|
||||
CS.mpc_lkas_request_prepare,
|
||||
CS.mpc_lkas_active)
|
||||
can_sends.append(pack)
|
||||
can_sends.append(pack)
|
||||
|
||||
self.apply_torque_last = apply_torque
|
||||
|
||||
|
||||
Reference in new issue
Block a user