From 6923c35e7dc4062698dcc5faf59971b309609a7c Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sun, 3 May 2026 13:28:00 -0500 Subject: [PATCH] Update latcontrol_pid.py --- selfdrive/controls/lib/latcontrol_pid.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/controls/lib/latcontrol_pid.py b/selfdrive/controls/lib/latcontrol_pid.py index 684570682..242fdfe2f 100644 --- a/selfdrive/controls/lib/latcontrol_pid.py +++ b/selfdrive/controls/lib/latcontrol_pid.py @@ -39,18 +39,18 @@ def get_civic_bosch_modified_pid_output_scale(desired_angle_deg: float, desired_ def get_civic_bosch_modified_pid_output_alpha(desired_angle_deg: float, desired_angle_delta_deg: float, v_ego: float, output_torque: float, prev_output_torque: float) -> float: abs_angle = abs(desired_angle_deg) - if abs_angle < 3.0 or abs_angle > 20.0: + if abs_angle < 3.0 or abs_angle > 22.0: return 1.0 speed_weight = min(max((v_ego - 4.0) / 10.0, 0.0), 1.0) onset = min(max((abs_angle - 3.0) / 5.0, 0.0), 1.0) - cutoff = min(max((20.0 - abs_angle) / 6.0, 0.0), 1.0) + cutoff = min(max((22.0 - abs_angle) / 8.0, 0.0), 1.0) band_weight = onset * cutoff transition_weight = min(abs(desired_angle_delta_deg) / 0.35, 1.0) sign_change_weight = 1.0 if (output_torque * prev_output_torque) < 0.0 else 0.0 - smoothing = band_weight * (0.32 + (0.22 * speed_weight) + (0.10 * transition_weight) + (0.10 * sign_change_weight)) - return min(max(1.0 - smoothing, 0.22), 1.0) + smoothing = band_weight * (0.36 + (0.22 * speed_weight) + (0.12 * transition_weight) + (0.12 * sign_change_weight)) + return min(max(1.0 - smoothing, 0.18), 1.0) class LatControlPID(LatControl):