Skip to content

feat: coordinate persistent detector collections - #111

Merged
DonLakeFlyer merged 1 commit into
sync-upstream-masterfrom
persistent-detector-collection
Sep 4, 2026
Merged

feat: coordinate persistent detector collections#111
DonLakeFlyer merged 1 commit into
sync-upstream-masterfrom
persistent-detector-collection

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Owner

Adopts the persistent-collection tunnel protocol (TagTrackerTunnelProtocol f31024e7) for Python-mode rotations. The uavrt (C++ detector) path is unaffected except for the protocol-version gate noted below.

Protocol

  • Replace START/STOP_ROTATION_DETECTION with START_COLLECTION, START_COLLECTION_SLICE and FINISH_COLLECTION, keyed by a per-rotation collection_id
  • Handle COLLECTION_STATUS and gate slice completion on it instead of counting detector pulses
  • Drop pulses and bearing results whose collection_id does not match the active rotation
  • Track the controller protocol_version from its heartbeat; expose protocolCompatible / controllerProtocolVersion to QML

Behaviour change affecting both detection modes

SendTunnelCommandState now refuses to send any tunnel command until a compatible controller heartbeat has been received (and errors the state machine with a clear message otherwise). A controller without protocol_version in its heartbeat, or with a different version, is unusable with this build by design.

State machine

Build

  • TunnelProtocol CPM pin bumped to f31024e7

Notes

  • Pre-commit clang-format / clang-tidy / vehicle-null-check failures on these files are pre-existing across custom/ (baseline CustomPlugin.cc has 364 clang-format diffs; all 3 null-check hits are on untouched lines). Not reformatting unrelated code here.
  • No automated tests for the protocol-compat gate; custom/ has no C++ unit-test infrastructure yet.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Adopt the persistent-collection tunnel protocol (TagTrackerTunnelProtocol
f31024e7) for Python-mode rotations.

Protocol
- Replace START/STOP_ROTATION_DETECTION with START_COLLECTION,
  START_COLLECTION_SLICE and FINISH_COLLECTION keyed by a per-rotation
  collection_id
- Handle COLLECTION_STATUS and gate slice completion on it instead of
  counting detector pulses
- Drop pulses and bearing results whose collection_id does not match the
  active rotation
- Track the controller protocol_version from its heartbeat; expose
  protocolCompatible/controllerProtocolVersion to QML and refuse to send
  tunnel commands until a compatible heartbeat has been seen

State machine
- SendTunnelCommandState takes an ackTimeoutMs parameter; StartCollection
  uses 35 s because the controller blocks up to 30 s waiting for detectors
  before acking (DonLakeFlyer/MavlinkTagController2#118)
- FinishCollection uses 20 s because the controller tears down detector
  processes (up to 15 s) before acking
- Stop handler sends FINISH_COLLECTION cancel for the active collection
- PythonRotateAndCaptureState listens for collection-wide FAILED status for
  its whole lifetime; slice failures between headings are no longer lost
- Last COLLECTION_STATUS for the active collection is cached so a slice wait
  state that connects after SLICE_COMPLETE arrived still sees it
- Drop dead channelizer heartbeat handling; the controller is the only sender
- rotationInProgress is set before a rotation/auto-detection machine starts
  and cleared when it finishes or stops; both the C++ entry points and the
  QML action use it so a second start during async setup is rejected
- Stop handler always runs local cleanup even when the cancel cannot be sent
- Python-mode rotation/auto-detection is rejected while manual detection is
  running; the controller only accepts START_COLLECTION from HAS_TAGS
- Drop collection-tagged pulses that do not match the active collection even
  when no rotation is active
- Distinguish lost heartbeat from version mismatch in the send-gate error

Build
- Bump TunnelProtocol CPM pin to f31024e7

This comment was marked as low quality.

@DonLakeFlyer
DonLakeFlyer merged commit b3367b1 into sync-upstream-master Sep 4, 2026
3 of 4 checks passed
@DonLakeFlyer
DonLakeFlyer deleted the persistent-detector-collection branch September 4, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants