From d328f2a9288ce03c8c5e285f5df190735e53cee6 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 21 Jan 2021 08:14:50 -0600 Subject: [PATCH] INDI: Time constant is used based on breakpoints (#19858) * Time constant is used based on break points * no need for alpha class variable old-commit-hash: 76cf50066936e60a9a6c0fd144d48f33728e12c6 --- selfdrive/controls/lib/latcontrol_indi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/latcontrol_indi.py b/selfdrive/controls/lib/latcontrol_indi.py index 09bfbcc5a9..277f0e0779 100644 --- a/selfdrive/controls/lib/latcontrol_indi.py +++ b/selfdrive/controls/lib/latcontrol_indi.py @@ -40,7 +40,6 @@ class LatControlINDI(): self._G = (CP.lateralTuning.indi.actuatorEffectivenessBP, CP.lateralTuning.indi.actuatorEffectivenessV) self._outer_loop_gain = (CP.lateralTuning.indi.outerLoopGainBP, CP.lateralTuning.indi.outerLoopGainV) self._inner_loop_gain = (CP.lateralTuning.indi.innerLoopGainBP, CP.lateralTuning.indi.innerLoopGainV) - self.alpha = 1. - DT_CTRL / (self.RC + DT_CTRL) self.sat_count_rate = 1.0 * DT_CTRL self.sat_limit = CP.steerLimitTimer @@ -104,7 +103,8 @@ class LatControlINDI(): rate_des = math.radians(self.rate_steers_des) # Expected actuator value - self.delayed_output = self.delayed_output * self.alpha + self.output_steer * (1. - self.alpha) + alpha = 1. - DT_CTRL / (self.RC + DT_CTRL) + self.delayed_output = self.delayed_output * alpha + self.output_steer * (1. - alpha) # Compute acceleration error rate_sp = self.outer_loop_gain * (steers_des - self.x[0]) + rate_des