Skip to content

Commit

Permalink
check if speeds is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee committed Jan 5, 2022
1 parent 9720dbe commit 1711951
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/longcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def update(self, active, CS, CP, long_plan, accel_limits):
output_accel = 0.

# tracking objects and driving
elif self.long_control_state == LongCtrlState.pid:
elif self.long_control_state == LongCtrlState.pid and len(speeds):
self.v_pid = speeds[0]

# Toyota starts braking more when it thinks you want to stop
Expand Down

0 comments on commit 1711951

Please sign in to comment.