add speed_logic daemon: write speed + cruise warning display params

Standalone managed process (selfdrive.clearpilot.speed_logicd) that
ticks SpeedState at 2 Hz from cereal subscriptions. Decoupled from
controlsd so self-driving timing isn't affected.

Inputs:
- gpsLocation.speed + hasFix (vehicle speed)
- carState.cruiseState (cruise speed, enabled, standstill)
- CarSpeedLimit memory param (will be populated when carstate.py CAN-FD
  decode is ported; 0 until then — speed-limit + warning logic
  naturally short-circuits)
- IsMetric persistent param (read once at startup)

Outputs (memory params, gated on change to avoid 2 Hz tmpfs churn):
- ClearpilotSpeedDisplay, ClearpilotHasSpeed, ClearpilotSpeedUnit
- ClearpilotSpeedLimitDisplay, ClearpilotIsMetric
- ClearpilotCruiseWarning, ClearpilotCruiseWarningSpeed
- ClearpilotPlayDing (one-shot trigger consumed by soundd)

speed_logic.py copied verbatim from broken; speed_logicd.py is new
glue. Registered as PythonProcess gated on only_onroad.
This commit is contained in:
2026-05-03 22:52:39 -05:00
parent 5d2fe5248b
commit 41c154014a
3 changed files with 177 additions and 0 deletions
+3
View File
@@ -86,6 +86,9 @@ procs = [
# Uses Quectel modem AT commands via mmcli. Self-driving does NOT consume this; locationd
# is patched to skip gpsLocation. Used only for system clock + UI speed + dashcam metadata.
PythonProcess("gpsd", "system.clearpilot.gpsd", qcomgps, enabled=TICI),
# CLEARPILOT: speed/cruise overlay daemon. Reads gpsLocation + carState, writes display
# params for the onroad UI; asserts ClearpilotPlayDing on speed-limit warning transitions.
PythonProcess("speed_logicd", "selfdrive.clearpilot.speed_logicd", only_onroad),
# PythonProcess("ugpsd", "system.ugpsd", only_onroad, enabled=TICI),
#PythonProcess("navd", "selfdrive.navd.navd", only_onroad),
PythonProcess("pandad", "selfdrive.boardd.pandad", always_run),