mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-04-07 11:33:59 +08:00
controlsd: fix steer_limited_by_safety not updating under MADS (#1716)
The `steer_limited_by_safety` update in `publish()` is gated by `selfdriveState.active`, which is False during MADS lateral-only control. This causes the flag to never update once cruise deactivates — it stays stuck at whatever value it had during the last ramp-up (typically True), permanently suppressing the saturation timer in `_check_saturation` and preventing the "Turn Exceeds Steering Limit" alert from firing. Use `CC.latActive` instead, which already accounts for MADS via `get_lat_active()` in ControlsExt. Bug was introduced in #446 (MADS), which updated `CC.latActive` to use `mads.active` but missed updating the `steer_limited_by_safety` gate in `publish()`.
This commit is contained in:
@@ -185,7 +185,7 @@ class Controls(ControlsExt):
|
||||
hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture
|
||||
hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture
|
||||
|
||||
if self.sm['selfdriveState'].active:
|
||||
if self.get_lat_active(self.sm):
|
||||
CO = self.sm['carOutput']
|
||||
if self.CP.steerControlType == car.CarParams.SteerControlType.angle:
|
||||
self.steer_limited_by_safety = abs(CC.actuators.steeringAngleDeg - CO.actuatorsOutput.steeringAngleDeg) > \
|
||||
|
||||
Reference in New Issue
Block a user