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

* only if braking is desired

* use v_target to determine stopping

* more clear?
old-commit-hash: 113988ae31
commatwo_master
Shane Smiskol 4 years ago committed by GitHub
parent a96d3f46bf
commit 996594fa29
  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