From cc0ba78b696d0d74267b170f058945fcdc6068f8 Mon Sep 17 00:00:00 2001 From: grekiki <96022003+GregorKikelj@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:47:53 +0200 Subject: [PATCH] More accurate jerk limits (#24755) * More accurate jerk limits * Min is not - max For example max_curvature_rate can be negative. * reduce diff old-commit-hash: b941b39c56db2d9d7f756cb0949ef6a7cf61774a --- selfdrive/controls/lib/drive_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index 1fecdd7c6..d79f94bbf 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -122,7 +122,7 @@ def get_lag_adjusted_curvature(CP, v_ego, psis, curvatures, curvature_rates): # This is the "desired rate of the setpoint" not an actual desired rate desired_curvature_rate = curvature_rates[0] - max_curvature_rate = MAX_LATERAL_JERK / (v_ego**2) + max_curvature_rate = MAX_LATERAL_JERK / (v_ego**2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755 safe_desired_curvature_rate = clip(desired_curvature_rate, -max_curvature_rate, max_curvature_rate)