From a06ffc48c112057319ad9a3bcc5ce38198385dbf Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 1 Sep 2021 15:28:16 -0700 Subject: [PATCH] Smarter longitudinal lag compensations (#22094) * smarter lag compensations * need to use speed from plan * update ref Co-authored-by: Harald Schafer old-commit-hash: edae2218d76e3fb81839eabab344c9dabc852fe9 --- selfdrive/controls/lib/longcontrol.py | 2 +- selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 2335f0885f..09e68faf90 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -81,7 +81,7 @@ class LongControl(): if len(long_plan.speeds) == CONTROL_N: v_target = interp(DEFAULT_LONG_LAG, T_IDXS[:CONTROL_N], long_plan.speeds) v_target_future = long_plan.speeds[-1] - a_target = interp(DEFAULT_LONG_LAG, T_IDXS[:CONTROL_N], long_plan.accels) + a_target = 2 * (v_target - long_plan.speeds[0])/DEFAULT_LONG_LAG - long_plan.accels[0] else: v_target = 0.0 v_target_future = 0.0 diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index c832d7012d..c33901e2c7 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -3e8037d39f40c59a2b9e86539e0952645b2cb3ea \ No newline at end of file +9f181202bbd6c64330bf4903ec265a179201057c \ No newline at end of file