Skip to content

feat(dronecan): v1.95 node pump — DroneCanNode async loop + NodeStatus heartbeat (DC-P04)#231

Open
avrabe wants to merge 1 commit into
mainfrom
feat/falcon-v1.95-dronecan-node-pump
Open

feat(dronecan): v1.95 node pump — DroneCanNode async loop + NodeStatus heartbeat (DC-P04)#231
avrabe wants to merge 1 commit into
mainfrom
feat/falcon-v1.95-dronecan-node-pump

Conversation

@avrabe

@avrabe avrabe commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

The runtime that ties the verified transfer layer to the relay-hal CanBus seam — completing the DroneCAN arc (v1.92 foundation → v1.93 ESC command → v1.94 sensors → v1.95 node pump).

  • node.rsDroneCanNode<C: CanBus> (mirrors UbxReader). poll() awaits one frame and drives the verified ReassemblerTransfer; the async path adds only the bus await (dispatch is the proven v1.92 reassembler step). send_heartbeat() encodes + emits this node's NodeStatus single-frame transfer (static node-id; dynamic allocation is a follow-on). A bus recv error propagates (fallible-as-health).
  • msg.rsencode_node_status (inverse of decode_node_status).

No spar change: dronecan.aadl already models the Reassemble + Heartbeat threads (v1.92); the pump orchestrates them.

Verification

Property Method Result
NodeStatus encode↔decode round-trip (any in-range status) Kani DC-K09 SUCCESSFUL
async poll ≡ sync Reassembler::push (same frame) unit (mock CanBus + hand-rolled block_on) pass
heartbeat TX round-trips through RX unit pass
bus recv error propagates unit pass
  • cargo test -p relay-dronecan: 40/40. cargo kani -p relay-dronecan: 9/9 SUCCESSFUL.
  • No external async-runtime dep (hand-rolled block_on, the falcon-gnss-ubx pattern).
  • rivet: SWREQ-FALCON-DC-P04 + FV-FALCON-DC-004 (test-level, 5 steps). rivet validate PASS, 0 gaps.
  • Clean-room (cold subagent): 10/10 confirm.

Scope (deliberate, evidence-backed): gnss.Fix2 DEFERRED → FEAT-FALCON-v1.95g

I fetched the actual DSDL before deciding — it corrected my int64 assumption: Fix2 uses int37 lat/lon + int27 heights (bit-packed), and the leading uavcan.Timestamp width is ambiguous in the summarised spec. A self-constructed round-trip test would pass even with wrong offsets, so a flight-critical GPS decoder must be validated against a real captured frame / libcanard reference, not self-tested. Recorded as a validation-gated backlog milestone.

Falsification

Wrong if the async poll dispatches a frame differently from the sync reassembler, a heartbeat the node emits fails to decode back to its NodeStatus, or a bus recv error is swallowed instead of propagated.

🤖 Generated with Claude Code

…s heartbeat (DC-P04)

The runtime that ties the verified transfer layer to the relay-hal CanBus seam,
completing the DroneCAN arc.
- node.rs: DroneCanNode<C: CanBus> (mirrors UbxReader). poll() awaits one frame
  and drives the verified Reassembler -> Transfer; the async path adds ONLY the
  bus await (dispatch is the v1.92 reassembler step). send_heartbeat() encodes +
  emits this node's NodeStatus single-frame transfer (static node-id; dynamic
  allocation a follow-on). A bus recv error propagates (fallible-as-health).
- msg.rs: encode_node_status (inverse of decode_node_status, the heartbeat
  encoder).

No spar change: dronecan.aadl already models the Reassemble + Heartbeat threads
(v1.92); the pump orchestrates them.

Verification:
- Kani DC-K09 verify_node_status_round_trip: decode(encode(s)) == Some(s) for any
  in-range NodeStatus (the heartbeat a receiving node decodes byte-identical).
  9/9 relay-dronecan harnesses SUCCESSFUL.
- 40 tests: NodeStatus encode/decode round-trip; poll() reassembles identically
  to a sync push (async==sync equivalence over a mock CanBus + hand-rolled
  block_on, the falcon-gnss-ubx pattern); heartbeat TX round-trips through RX;
  bus error propagates.

rivet: SWREQ-FALCON-DC-P04 + FV-FALCON-DC-004 (test-level, 5 steps). validate
PASS, 0 gaps. Clean-room 10/10.

SCOPE (deliberate, evidence-backed): gnss.Fix2 DEFERRED to FEAT-FALCON-v1.95g
(backlog). Its DSDL is bit-packed (int37 lat/lon, int27 heights) and the
uavcan.Timestamp width is ambiguous in the summarised spec — a self-constructed
round-trip test would pass even with WRONG offsets, so a flight-critical GPS
decoder must be validated against a real captured frame / libcanard, not
self-tested. Fetched the DSDL (which corrected my int64 assumption) before making
this call.

Falsification: this release is wrong if the async poll dispatches a frame
differently from the sync reassembler, if a heartbeat the node emits fails to
decode back to its NodeStatus, or if a bus recv error is swallowed instead of
propagated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant