From 80deeaa38b8c9bd14faad236bd99b54c18750fd3 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sun, 22 Mar 2020 17:33:10 -0500 Subject: [PATCH] Fix for lead accel calculation algorithm (#83) * add profile mods to opParams for live tuning to debug FCW * debug * revert * Test stock * fix accel algorithm * tmp * tmp * tmp --- selfdrive/controls/lib/long_mpc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/long_mpc.py b/selfdrive/controls/lib/long_mpc.py index 63f82be1e32911..709f6bc7f7d425 100644 --- a/selfdrive/controls/lib/long_mpc.py +++ b/selfdrive/controls/lib/long_mpc.py @@ -125,12 +125,12 @@ def calculate_lead_accel(self): return a_calculated if a_calculated < 0 <= a_lead: # accel over time is negative and current accel is zero or positive - if a_lead < -a_calculated * 0.5: + if a_lead < -a_calculated * 0.55: # half of accel over time is less than current positive accel, we're not decelerating after long decel return a_calculated if a_lead <= 0 < a_calculated: # accel over time is positive and current accel is zero or negative - if -a_lead < a_calculated * 0.5: + if -a_lead < a_calculated * 0.45: # half of accel over time is greater than current negative accel, we're not accelerating after long accel return a_calculated