From 30ba3096a31b7c5efda0160c15bf60ccdf9b94b0 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 8 Sep 2022 21:43:04 -0700 Subject: [PATCH] Longcontrol: fix possible reference before assignment (#25715) fix possible reference before assignment old-commit-hash: 056b2ec2edb40ce48871975bdbf19d9652c867f3 --- selfdrive/controls/lib/longcontrol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 082e7725d7..f72995d414 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -92,6 +92,7 @@ class LongControl: v_target_1sec = interp(self.CP.longitudinalActuatorDelayUpperBound + t_since_plan + 1.0, T_IDXS[:CONTROL_N], speeds) else: v_target = 0.0 + v_target_now = 0.0 v_target_1sec = 0.0 a_target = 0.0 @@ -132,7 +133,6 @@ class LongControl: feedforward=a_target, freeze_integrator=freeze_integrator) - self.last_output_accel = clip(output_accel, accel_limits[0], accel_limits[1]) return self.last_output_accel