From 9f202e63f506ff3a95bae61eebe891edc016d3e5 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 27 Jan 2022 12:31:36 +0100 Subject: [PATCH] clip steer saturation counter to steerLimitTimer (#23638) * clip steer saturation counter to steerLimitTimer * update ref old-commit-hash: ee71fd2fccdca9c311d7912f1fbaae6d50aac27a --- selfdrive/car/interfaces.py | 1 + selfdrive/controls/lib/latcontrol.py | 4 ++-- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index b7748aa5dc..afd7091194 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -98,6 +98,7 @@ class CarInterfaceBase(ABC): ret.longitudinalTuning.kiV = [1.] ret.longitudinalActuatorDelayLowerBound = 0.15 ret.longitudinalActuatorDelayUpperBound = 0.15 + ret.steerLimitTimer = 1.0 return ret @abstractmethod diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 983437890e..eb16aca2e8 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -24,5 +24,5 @@ class LatControl(ABC): self.sat_count += self.sat_count_rate else: self.sat_count -= self.sat_count_rate - self.sat_count = clip(self.sat_count, 0.0, 1.0) - return self.sat_count > self.sat_limit + self.sat_count = clip(self.sat_count, 0.0, self.sat_limit) + return self.sat_count > (self.sat_limit - 1e-3) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 0b9f68c9f8..a8aa6a1292 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -14133069e1f226b9c981d09653fb74f5020f725e \ No newline at end of file +498e43b0cc062291ec159d7f09b69d9f7024aeca \ No newline at end of file