From ed174aa82cf2dcebc037039e5a74a963edc877b1 Mon Sep 17 00:00:00 2001 From: infiniteCable <75014343+infiniteCable@users.noreply.github.com> Date: Sat, 19 Apr 2025 16:41:00 +0200 Subject: [PATCH] Update disturbance_controller.py --- selfdrive/controls/lib/disturbance_controller.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/selfdrive/controls/lib/disturbance_controller.py b/selfdrive/controls/lib/disturbance_controller.py index 161752c26..c52a0f568 100644 --- a/selfdrive/controls/lib/disturbance_controller.py +++ b/selfdrive/controls/lib/disturbance_controller.py @@ -49,11 +49,13 @@ class DisturbanceController: if calibrated_pose is None or CS.vEgo < 0.1: return desired_curvature - steering_angle_without_offset = math.radians(CS.steeringAngleDeg - params.angleOffsetDeg) - actual_curvature = -VM.calc_curvature_3dof(calibrated_pose.acceleration.y, calibrated_pose.acceleration.x, - calibrated_pose.angular_velocity.yaw, CS.vEgo, steering_angle_without_offset, - 0.) - + #steering_angle_without_offset = math.radians(CS.steeringAngleDeg - params.angleOffsetDeg) + #actual_curvature = -VM.calc_curvature_3dof(calibrated_pose.acceleration.y, calibrated_pose.acceleration.x, + # calibrated_pose.angular_velocity.yaw, CS.vEgo, steering_angle_without_offset, + # 0.) + + actual_curvature = calibrated_pose.acceleration.y / (CS.vEgo ** 2) + alpha = self.compute_dynamic_alpha(desired_curvature) reaction = self.lowpass_filter(actual_curvature, alpha) self.reaction_hist.append(reaction)