longitudinal: only apply overshoot prevention when braking (#22986)

* only if braking is desired

* use v_target to determine stopping

* more clear?
pull/23010/head
Shane Smiskol 4 years ago committed by GitHub
parent 35c0319f6c
commit 113988ae31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/controls/lib/longcontrol.py

@ -107,7 +107,7 @@ class LongControl():
# Toyota starts braking more when it thinks you want to stop
# Freeze the integrator so we don't accelerate to compensate, and don't allow positive acceleration
prevent_overshoot = not CP.stoppingControl and CS.vEgo < 1.5 and v_target_future < 0.7
prevent_overshoot = not CP.stoppingControl and CS.vEgo < 1.5 and v_target_future < 0.7 and v_target_future < v_target
deadzone = interp(CS.vEgo, CP.longitudinalTuning.deadzoneBP, CP.longitudinalTuning.deadzoneV)
freeze_integrator = prevent_overshoot

Loading…
Cancel
Save