Update latcontrol_torque.py

This commit is contained in:
firestar5683
2025-10-03 20:05:27 -05:00
parent 72dc8dd753
commit 13c3070fa1
+6 -2
View File
@@ -24,8 +24,12 @@ class LatControl(ABC):
self.sat_count = 0.
def _check_saturation(self, saturated, CS, steer_limited_by_safety, curvature_limited):
# Saturated only if control output is not being limited by car torque/angle rate limits
if (saturated or curvature_limited) and CS.vEgo > self.sat_check_min_speed and not steer_limited_by_safety and not CS.steeringPressed:
# Treat either controller saturation, curvature limiting, or the safety layer
# clamping the request as a saturation event. The additional safety check
# catches cases where the torque request is being clipped
saturated = saturated or curvature_limited or steer_limited_by_safety
if saturated and CS.vEgo > self.sat_check_min_speed and not CS.steeringPressed:
self.sat_count += self.sat_count_rate
else:
self.sat_count -= self.sat_count_rate