DEC: adjust dynamic speed adaptation parameters (#813)

* early and better

* Update sunnypilot/selfdrive/controls/lib/dec/constants.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
This commit is contained in:
Kumar
2025-04-18 11:02:50 -07:00
committed by GitHub
parent 86a390780e
commit 65431f4e2f
2 changed files with 3 additions and 4 deletions
@@ -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
+1 -1
View File
@@ -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
)