Longcontrol: fix possible reference before assignment (#25715)

fix possible reference before assignment
old-commit-hash: 056b2ec2ed
taco
Shane Smiskol 3 years ago committed by GitHub
parent 18399bf618
commit 30ba3096a3
  1. 2
      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

Loading…
Cancel
Save