From d6fb92825bbcc9c474d1de83e657a3c52457edeb Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 31 Mar 2022 14:17:22 -0700 Subject: [PATCH] LongitudinaPlanner: add comment about lateral accel calculation (#24096) * space * if old-commit-hash: 5a8b4bbcaa1fdf2555ff4f60c451baa574123082 --- selfdrive/controls/lib/longitudinal_planner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index fd76142366..8aade9b9c4 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -35,6 +35,8 @@ def limit_accel_in_turns(v_ego, angle_steers, a_target, CP): this should avoid accelerating when losing the target in turns """ + # FIXME: This function to calculate lateral accel is incorrect and should use the VehicleModel + # The lookup table for turns should also be updated if we do this a_total_max = interp(v_ego, _A_TOTAL_MAX_BP, _A_TOTAL_MAX_V) a_y = v_ego ** 2 * angle_steers * CV.DEG_TO_RAD / (CP.steerRatio * CP.wheelbase) a_x_allowed = math.sqrt(max(a_total_max ** 2 - a_y ** 2, 0.))