diff --git a/sunnypilot/selfdrive/controls/lib/dec/constants.py b/sunnypilot/selfdrive/controls/lib/dec/constants.py index c1e3726606..48f4203e93 100644 --- a/sunnypilot/selfdrive/controls/lib/dec/constants.py +++ b/sunnypilot/selfdrive/controls/lib/dec/constants.py @@ -2,12 +2,11 @@ class WMACConstants: LEAD_WINDOW_SIZE = 5 LEAD_PROB = 0.5 - SLOW_DOWN_WINDOW_SIZE = 4 + SLOW_DOWN_WINDOW_SIZE = 5 SLOW_DOWN_PROB = 0.6 SLOW_DOWN_BP = [0., 10., 20., 30., 40., 50., 55., 60.] - #SLOW_DOWN_DIST = [25., 38., 55., 75., 95., 115., 130., 150.] - SLOW_DOWN_DIST = [30., 45., 60., 80., 100., 120., 135., 150.] + SLOW_DOWN_DIST = [25., 38., 55., 75., 95., 115., 130., 150.] SLOWNESS_WINDOW_SIZE = 12 SLOWNESS_PROB = 0.5 diff --git a/sunnypilot/selfdrive/controls/lib/dec/dec.py b/sunnypilot/selfdrive/controls/lib/dec/dec.py index 0c33da500a..812e5cc15f 100644 --- a/sunnypilot/selfdrive/controls/lib/dec/dec.py +++ b/sunnypilot/selfdrive/controls/lib/dec/dec.py @@ -164,7 +164,7 @@ class DynamicExperimentalController: """ Adapts the slow-down threshold based on vehicle speed and recent behavior. """ - slowdown_scaling_factor: float = (1.0 + 0.05 * np.log(1 + len(self._slow_down_gmac.data))) + slowdown_scaling_factor: float = (1.0 + 0.03 * np.log(1 + len(self._slow_down_gmac.data))) adaptive_threshold: float = float( interp(self._v_ego_kph, WMACConstants.SLOW_DOWN_BP, WMACConstants.SLOW_DOWN_DIST) * slowdown_scaling_factor )