1.6 KiB
1.6 KiB
CAN-FD Issues to Investigate
Cruise Control Desync on Hot Start
Problem
When the car is already in cruise control mode before openpilot starts (or before controlsd initializes), pressing the cruise control button causes a desync:
- Car has active cruise control when openpilot comes online
- Driver presses cruise button — car interprets as "toggle off" (cruise was already on)
- openpilot interprets it as "engage" (from its perspective, it hasn't seen a cruise enable transition)
- Result: car disengages cruise, but openpilot thinks it just engaged lateral mode
Proposed Fix
When controlsd first reads carState and discovers cruiseState.enabled is already true:
- Set a flag
cruise_was_active_at_start = True - While this flag is set, do NOT allow openpilot to transition to engaged state on button press
- Only clear the flag after seeing
cruiseState.enabledgo toFalseat least once (a full stop of cruise, not just standstill/pause) - After the first full off cycle, normal engagement logic resumes
Status
- Could not reproduce on 2026-04-14 — may require specific timing (openpilot restart while driving with cruise active)
- Need to capture telemetry data during reproduction to see exact signal sequence
- Key telemetry groups to watch:
cruise(enabled, available, ACCMode, VSetDis),buttons(cruise_button)
Relevant Code
selfdrive/controls/controlsd.py— engagement state machineselfdrive/car/hyundai/carstate.py— CAN-FD cruise state parsingselfdrive/car/interfaces.py— pcm_enable / cruise state transitions