From 1dd9ed10421fb90f9aa2c6243afd5f1bf0c752f2 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Wed, 31 Jul 2024 00:00:09 -0400 Subject: [PATCH 1/3] more aggressive jerk --- selfdrive/car/hyundai/carcontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index a93b6a14c0..7c7dfbb1c9 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -112,6 +112,7 @@ class CarController(CarControllerBase): self.accel_raw = 0 self.accel_val = 0 + self.accel_last_jerk = 0 def calculate_lead_distance(self, hud_control: car.CarControl.HUDControl) -> float: lead_one = self.sm["radarState"].leadOne @@ -485,7 +486,7 @@ class CarController(CarControllerBase): elif actuators.longControlState == LongCtrlState.stopping:# or hud_control.softHold > 0: accel_diff = 0.0 else: - accel_diff = self.accel_raw - self.accel_last + accel_diff = self.accel_raw - self.accel_last_jerk accel_diff /= DT_CTRL self.jerk = self.jerk * 0.9 + accel_diff * 0.1 From 74481be4ff5a411aa07c1052d27fb87beab7e337 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Wed, 31 Jul 2024 00:02:04 -0400 Subject: [PATCH 2/3] same rate up/down --- selfdrive/car/hyundai/carcontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 7c7dfbb1c9..9653b5b537 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -539,8 +539,8 @@ class CarController(CarControllerBase): def make_accel(self, actuators): long_control = actuators.longControlState is_ice = not self.CP.flags & (HyundaiFlags.HYBRID | HyundaiFlags.EV) - rate_up = 0.1 * 1 if is_ice else self.jerk_u - rate_down = 0.1 * 1 if is_ice else self.jerk_l + rate_up = 0.1 + rate_down = 0.1 if long_control == LongCtrlState.off: self.accel_raw, self.accel_val = 0, 0 else: From d472f129e61b030571a278de153c72e7b06b5d52 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Wed, 31 Jul 2024 00:03:04 -0400 Subject: [PATCH 3/3] stock stop distance again --- selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 7296a28b11..a2df527a55 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -55,7 +55,7 @@ T_IDXS = np.array(T_IDXS_LST) FCW_IDXS = T_IDXS < 5.0 T_DIFFS = np.diff(T_IDXS, prepend=[0.]) COMFORT_BRAKE = 2.5 -STOP_DISTANCE = 8.0 +STOP_DISTANCE = 6.0 def get_jerk_factor(personality=custom.LongitudinalPersonalitySP.standard): if personality==custom.LongitudinalPersonalitySP.relaxed: