From 254076de39ad06ebcc6b227364a6ca2f9857e2a0 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Thu, 3 Apr 2025 23:39:06 +0200 Subject: [PATCH] Refactor steering angle logic for smoother control adjustments Refactored the calculation and application of the steering angle to improve code clarity and ensure smoother transitions. Removed unused parameter update logic in `latcontrol_angle.py` and enhanced handling of driver overrides in `carcontroller.py`. --- opendbc_repo | 2 +- selfdrive/controls/lib/latcontrol_angle.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index e3196167d6..6f05e7d5a2 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit e3196167d6434bef6c7281b674a15de7a9d3ab90 +Subproject commit 6f05e7d5a20c2c1558d9b2b31bfc77351509b99e diff --git a/selfdrive/controls/lib/latcontrol_angle.py b/selfdrive/controls/lib/latcontrol_angle.py index 026051cf16..b75ba9ba92 100644 --- a/selfdrive/controls/lib/latcontrol_angle.py +++ b/selfdrive/controls/lib/latcontrol_angle.py @@ -21,10 +21,10 @@ class LatControlAngle(LatControl): self.smoothing_factor_incr = 0. def update(self, active, CS, VM, params, steer_limited_by_controls, desired_curvature, calibrated_pose, curvature_limited): - self.count += 1 - if self.count % 25 == 0 and (smoothingFactorParam := self.params.get("HkgTuningAngleSmoothingFactor")): - self.count = 0 - self.smoothing_factor_incr = float(smoothingFactorParam) / 10.0 + # self.count += 1 + # if self.count % 25 == 0 and (smoothingFactorParam := self.params.get("HkgTuningAngleSmoothingFactor")): + # self.count = 0 + # self.smoothing_factor_incr = float(smoothingFactorParam) / 10.0 angle_log = log.ControlsState.LateralAngleState.new_message()