More accurate jerk limits (#24755)

* More accurate jerk limits

* Min is not - max

For example max_curvature_rate can be negative.

* reduce diff
This commit is contained in:
grekiki
2022-06-16 19:47:53 +02:00
committed by GitHub
parent d4886b2c29
commit b941b39c56
+1 -1
View File
@@ -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)