|
|
@ -22,7 +22,7 @@ def smooth_value(val, prev_val, tau, dt=DT_MDL): |
|
|
|
alpha = 1 - np.exp(-dt/tau) if tau > 0 else 1 |
|
|
|
alpha = 1 - np.exp(-dt/tau) if tau > 0 else 1 |
|
|
|
return alpha * val + (1 - alpha) * prev_val |
|
|
|
return alpha * val + (1 - alpha) * prev_val |
|
|
|
|
|
|
|
|
|
|
|
def clip_curvature(v_ego, prev_curvature, new_curvature, roll): |
|
|
|
def clip_curvature(v_ego, prev_curvature, new_curvature, roll) -> tuple[float, bool]: |
|
|
|
# This function respects ISO lateral jerk and acceleration limits + a max curvature |
|
|
|
# This function respects ISO lateral jerk and acceleration limits + a max curvature |
|
|
|
v_ego = max(v_ego, MIN_SPEED) |
|
|
|
v_ego = max(v_ego, MIN_SPEED) |
|
|
|
max_curvature_rate = MAX_LATERAL_JERK / (v_ego ** 2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755 |
|
|
|
max_curvature_rate = MAX_LATERAL_JERK / (v_ego ** 2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755 |
|
|
|