From 24645c92dadebaf69e1115d0ccd44edba4148b65 Mon Sep 17 00:00:00 2001 From: Robbe Derks Date: Fri, 12 Aug 2022 11:30:19 +0200 Subject: [PATCH] Use steeringAngleDeg for angle control saturation warnings (#25404) * use steeringAngleDeg for angle control cars * update refs --- selfdrive/controls/controlsd.py | 9 +++++++-- selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 2f7c85aa7d..3b2307f04a 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -626,8 +626,13 @@ class Controls: if len(dpath_points): # Check if we deviated from the path # TODO use desired vs actual curvature - left_deviation = actuators.steer > 0 and dpath_points[0] < -0.20 - right_deviation = actuators.steer < 0 and dpath_points[0] > 0.20 + if self.CP.steerControlType == car.CarParams.SteerControlType.angle: + steering_value = actuators.steeringAngleDeg + else: + steering_value = actuators.steer + + left_deviation = steering_value > 0 and dpath_points[0] < -0.20 + right_deviation = steering_value < 0 and dpath_points[0] > 0.20 if left_deviation or right_deviation: self.events.add(EventName.steerSaturated) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 8c8f5d10fe..260e917fb1 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -461333164e531e3ffdac05b63b529aa5dce1186f +3c89454df9cf2f25a5759d523a8c595e69865505 \ No newline at end of file