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

* only if braking is desired

* use v_target to determine stopping

* more clear?
This commit is contained in:
Shane Smiskol
2021-11-29 04:29:32 -06:00
committed by GitHub
parent 35c0319f6c
commit 113988ae31
+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