byd: support SEAL steering feedback on 508 STEERING_TORQUE_ANGLE
The Seal EPS reports steering torque/prepare/activated state on
508 STEERING_TORQUE_ANGLE (different bit layout; driver torque factor
0.1), unlike the Han which uses 792 STEERING_TORQUE. The Seal's
fingerprint contains 508 but not 792, so alive-checking 792 tripped
canError ("Unknown Vehicle Variant") the moment the interface started.
- carstate: per-platform steering message selection (508 strict-checked
on Seal, 792 on Han; the other parsed opportunistically)
- carcontroller: don't send 792-layout camera feedback on the Seal;
stock 508 forwards unmodified for now (camera-feedback spoofing for
the Seal's 508 to be evaluated after a bus dump + road test)
- panda byd.h: rx check accepts 792 or 508 (first-seen-wins), torque
sampling handles both layouts, driver torque rescaled for 508's 0.1x
factor
- panda firmware rebuilt (panda_h7.bin.signed)
- tests: Seal(508) + Han(792) both verified canValid with correct
torque values; 120 safety tests + MISRA clean
This commit is contained in:
1 parent
264ebf956e
commit
b598ba5dcb
21 files changed
+57
-21
No files matched your search
@@ -4,7 +4,7 @@ from opendbc.car import Bus, structs
|
||||
from opendbc.car.lateral import apply_meas_steer_torque_limits
|
||||
from opendbc.car.interfaces import CarControllerBase
|
||||
from opendbc.car.byd.bydcan import BydCAN
|
||||
from opendbc.car.byd.values import CarControllerParams
|
||||
from opendbc.car.byd.values import CAR, CarControllerParams
|
||||
|
||||
VisualAlert = structs.CarControl.HUDControl.VisualAlert
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
@@ -30,6 +30,11 @@ 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
|
||||
|
||||
def update(self, CC, CC_SP, CS, now_nanos):
|
||||
# car control running in 100Hz
|
||||
actuators = CC.actuators
|
||||
@@ -75,11 +80,12 @@ class CarController(CarControllerBase):
|
||||
lkas_request_prepare, lkas_active,
|
||||
lkas_mode, CS.eps_activated)
|
||||
can_sends.append(pack)
|
||||
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)
|
||||
if self.send_steering_feedback:
|
||||
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)
|
||||
|
||||
self.apply_torque_last = apply_torque
|
||||
|
||||
|
||||
Reference in new issue
Block a user