From f5fead5e0bb3baf6d8b286e66568cf330444e358 Mon Sep 17 00:00:00 2001 From: "Mr.one" Date: Mon, 21 Apr 2025 09:45:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91carcontroller.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opendbc_repo/opendbc/car/volkswagen/carcontroller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py b/opendbc_repo/opendbc/car/volkswagen/carcontroller.py index 0e450437..7b5901c8 100644 --- a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py +++ b/opendbc_repo/opendbc/car/volkswagen/carcontroller.py @@ -51,13 +51,13 @@ class CarController(CarControllerBase): low_speed_thresh = 10 * CV.KPH_TO_MS # 10 km/h 以下视为低速 alpha = np.interp(CS.out.vEgo, [0, low_speed_thresh], [0.05, alpha_base]) # 低速更强滤波 -# 原始目标曲率 + # 原始目标曲率 target_curvature = actuators.curvature + (CS.qfk_curvature - CC.currentCurvature) -# 曲率滤波处理 + # 曲率滤波处理 apply_curvature = alpha * target_curvature + (1 - alpha) * self.apply_curvature_last -# === 限制曲率变化率 === + # === 限制曲率变化率 === max_delta = 0.0005 # 每帧最大变化量 delta = np.clip(apply_curvature - self.apply_curvature_last, -max_delta, max_delta) apply_curvature = self.apply_curvature_last + delta