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

* only if braking is desired

* use v_target to determine stopping

* more clear?
old-commit-hash: 113988ae31bd32db1576d88d5160be01faa63cb5
This commit is contained in:
Shane Smiskol
2021-11-29 04:29:32 -06:00
committed by GitHub
parent a96d3f46bf
commit 996594fa29
+1 -1
View File
@@ -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