SLC Wrong Speed Rejection

This commit is contained in:
firestarsdog
2026-05-13 20:40:14 -04:00
parent 01bcb40c50
commit 69e7ed3eae
2 changed files with 10 additions and 3 deletions
@@ -62,7 +62,7 @@ def make_sm(*, gas_pressed, enabled=True, accel_pressed=False, decel_pressed=Fal
"carControl": SimpleNamespace(longActive=True),
"carState": SimpleNamespace(gasPressed=gas_pressed, steeringAngleDeg=0.0),
"liveParameters": SimpleNamespace(angleOffsetDeg=0.0),
"mapdOut": SimpleNamespace(nextSpeedLimitDistance=0.0, nextSpeedLimit=0.0, speedLimit=0.0),
"mapdOut": SimpleNamespace(nextSpeedLimitDistance=0.0, nextSpeedLimit=0.0, speedLimit=0.0, waySelectionType=0),
"selfdriveState": SimpleNamespace(enabled=enabled),
"starpilotCarState": SimpleNamespace(accelPressed=accel_pressed, decelPressed=decel_pressed),
}
@@ -10,6 +10,7 @@ from concurrent.futures import ThreadPoolExecutor
from openpilot.common.constants import CV
from openpilot.common.realtime import DT_MDL
from cereal import custom
from openpilot.starpilot.common.starpilot_utilities import calculate_bearing_offset, calculate_distance_to_point, is_url_pingable
FREE_MAPBOX_REQUESTS = 100_000
@@ -424,8 +425,14 @@ class SpeedLimitController:
self.map_speed_limit = 0
self.next_speed_limit = 0
else:
self.map_speed_limit = sm["mapdOut"].speedLimit
self.next_speed_limit = sm["mapdOut"].nextSpeedLimit
way_sel = sm["mapdOut"].waySelectionType
if way_sel in (custom.WaySelectionType.current,
custom.WaySelectionType.predicted,
custom.WaySelectionType.extended):
self.map_speed_limit = sm["mapdOut"].speedLimit
self.next_speed_limit = sm["mapdOut"].nextSpeedLimit
else:
self.next_speed_limit = 0
if self.next_speed_limit > 0:
if self.map_speed_limit < self.next_speed_limit: