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:
Zeph
2026-02-25 00:52:48 -06:00
committed by GitHub
parent 03a14ff864
commit 7a43e2cb67

View File

@@ -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) > \