Files
StarPilot/openpilot/starpilot/models/tests/jetlink_fixture.py
T
Zeph Leggett ce766c0668 Stay engaged when Jetlink hands back
A Jetlink hand-back while engaged soft-disabled with Big Model Failed and
"Restart the car to retry", although the small model drives on and Jetlink
retries in seconds. Now nothing disengages: a Big Model Lost warning shows
for 5 s. A native chestnut's loss still raises Big Model Failed.

jetlink's swap events also refuse engaging for the second after a swap
(bigModelLoading) and hold the comm and localizer errors the swap's dropped
frame raises, as a chestnut load does. In control is the rule the swap
itself waits on (openpilot, or AOL armed or paused), and a gap in modeld's
runtime record holds the last state instead of reading as a switch.

The warning is a selfdrived alert, like aolAvailability: no new
OnroadEvent, so cereal and schema-policy.json are unchanged.
2026-10-18 16:18:37 -05:00

19 lines
919 B
Python

"""The Jetlink adapter's in-control rule over fixed messages, for its tests and selfdrived's."""
from types import SimpleNamespace
from jetlink.openpilot.testing import FakeSubMaster
from openpilot.starpilot.models import jetlink_adapter
IDLE = {"selfdriveState": SimpleNamespace(enabled=False, active=False),
"carControl": SimpleNamespace(enabled=False, latActive=False, longActive=False)}
AXES_IDLE = SimpleNamespace(desiredLateral=False, desiredLongitudinal=False, lateralActive=False, longitudinalActive=False)
ARMED_PAUSED = SimpleNamespace(allowedLatch=False, lateralArmed=True)
def rule(core=None, aol=None):
"""The adapter, its in_control() reading openpilot's services (idle unless given) and AOL's."""
op = jetlink_adapter.adapter()
op._sm = FakeSubMaster(op.IN_CONTROL_SERVICES, **{**IDLE, **(core or {})})
op._aol = FakeSubMaster(jetlink_adapter.AOL_SERVICES, **(aol or {}))
return op