feat(dronecan): v1.95 node pump — DroneCanNode async loop + NodeStatus heartbeat (DC-P04)#231
Open
avrabe wants to merge 1 commit into
Open
feat(dronecan): v1.95 node pump — DroneCanNode async loop + NodeStatus heartbeat (DC-P04)#231avrabe wants to merge 1 commit into
avrabe wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The runtime that ties the verified transfer layer to the relay-hal
CanBusseam — completing the DroneCAN arc (v1.92 foundation → v1.93 ESC command → v1.94 sensors → v1.95 node pump).node.rs—DroneCanNode<C: CanBus>(mirrorsUbxReader).poll()awaits one frame and drives the verifiedReassembler→Transfer; the async path adds only the bus await (dispatch is the proven v1.92 reassembler step).send_heartbeat()encodes + emits this node'sNodeStatussingle-frame transfer (static node-id; dynamic allocation is a follow-on). A bus recv error propagates (fallible-as-health).msg.rs—encode_node_status(inverse ofdecode_node_status).No spar change:
dronecan.aadlalready models the Reassemble + Heartbeat threads (v1.92); the pump orchestrates them.Verification
poll≡ syncReassembler::push(same frame)block_on)cargo test -p relay-dronecan: 40/40.cargo kani -p relay-dronecan: 9/9 SUCCESSFUL.block_on, the falcon-gnss-ubx pattern).SWREQ-FALCON-DC-P04+FV-FALCON-DC-004(test-level, 5 steps).rivet validatePASS, 0 gaps.Scope (deliberate, evidence-backed): gnss.Fix2 DEFERRED →
FEAT-FALCON-v1.95gI fetched the actual DSDL before deciding — it corrected my int64 assumption: Fix2 uses int37 lat/lon + int27 heights (bit-packed), and the leading
uavcan.Timestampwidth 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