Skip to content

Commit

Permalink
More accurate jerk limits (commaai#24755)
Browse files Browse the repository at this point in the history
* More accurate jerk limits

* Min is not - max

For example max_curvature_rate can be negative.

* reduce diff
  • Loading branch information
GregorKikelj authored and spektor56 committed Jul 1, 2022
1 parent b236a31 commit 0c154f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,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)
Expand Down

0 comments on commit 0c154f5

Please sign in to comment.