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`.
This commit is contained in:
DevTekVE
2025-04-03 23:39:06 +02:00
parent 2f836d1148
commit 254076de39
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -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()