Skip to content

feat(dronecan): v1.94 sensor ingest — float16 + esc.Status/mag/baro/battery decoders (DC-P03)#230

Merged
avrabe merged 1 commit into
mainfrom
feat/falcon-v1.94-dronecan-sensors
Jun 24, 2026
Merged

feat(dronecan): v1.94 sensor ingest — float16 + esc.Status/mag/baro/battery decoders (DC-P03)#230
avrabe merged 1 commit into
mainfrom
feat/falcon-v1.94-dronecan-sensors

Conversation

@avrabe

@avrabe avrabe commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

The DroneCAN sensor-ingest decoders (the SPI/I2C drivers' CAN-bus counterparts) on the v1.92 transfer layer, plus the shared float16 primitive. Also lands the PX4-parity roadmap from the gap analysis.

  • float16.rsf16_to_f32 (IEEE binary16 → f32: normals/subnormals/±inf/NaN/±0). Decode-only (falcon reads sensor float16; never emits it). No panic surface, so totality is free; correctness pinned by IEEE-half vectors.
  • sensors.rsdecode_esc_status (1034, FDI: rpm/voltage/current/temp, multi-frame 14B), decode_mag (1002), decode_baro (1028, float32+float16), decode_battery_info (1092 prefix: temp/voltage/current — the BatteryMonitor inputs over CAN). read_bits helper for the non-byte-aligned esc.Status fields.

Architecture (spar)

dronecan.aadl gains the SensorSample type + a Decode thread; spar analyze0 errors, Decode thread RTA 18µs ≤ 2ms telemetry deadline. node.wit regenerated (sample-out port + decode export).

Verification

Property Method Result
bit-reader total + result < 2^nbits Kani DC-K08 SUCCESSFUL
float16 values (IEEE-half vectors + edges) unit + proptest pass
all sensor decoders never panic (any payload) proptest pass
esc.Status fields / rpm sign-extend / mag / baro / battery prefix 7 unit tests pass
  • cargo test -p relay-dronecan: 36/36. cargo kani -p relay-dronecan: 8/8 SUCCESSFUL.
  • rivet: SWREQ-FALCON-DC-P03 + FV-FALCON-DC-003 (test-level, 12 steps). rivet validate PASS, 0 gaps.
  • Clean-room: 9 confirm (2 checks env-blocked by a full disk; self-verified via my own WIT-regen + validate).

PX4-parity roadmap (new)

FEAT-FALCON-v1.96..v1.103 from the gap analysis: parameter system (keystone) → pre-arm checks → calibration → failsafes → position-UX, + backlog (wind-est/multi-EKF/autotune). Scope move: gnss.Fix2 (variable covariance tail) → v1.95.

Falsification

Wrong if a real DroneCAN float16 telemetry value mis-decodes vs IEEE-754, a sensor decoder panics on any payload, read_bits returns >= 2^nbits, or spar analyze errors / the decode thread misses its deadline.

🤖 Generated with Claude Code

…attery decoders (DC-P03)

The DroneCAN sensor-ingest decoders (the SPI/I2C drivers' CAN-bus counterparts)
on the v1.92 transfer layer, plus the shared float16 primitive.
- float16.rs: f16_to_f32 (IEEE binary16 -> f32; normals/subnormals/inf/NaN).
  Decode-only (falcon reads sensor float16; never emits it). No panic surface.
- sensors.rs: decode_esc_status (1034, FDI: rpm/voltage/current/temp, multi-frame
  14B), decode_mag (1002, MagneticFieldStrength, single-frame), decode_baro
  (1028, StaticPressure float32+float16), decode_battery_info (1092 prefix:
  temp/voltage/current, the BatteryMonitor inputs over CAN). read_bits helper for
  the non-byte-aligned esc.Status fields (rpm int18, power_rating, esc_index).

Architecture (spar): dronecan.aadl gains the SensorSample data type + a Decode
thread; spar analyze 0 errors, the Decode thread RTA 18us <= its 2ms telemetry
deadline. node.wit regenerated (sample-out port + decode export).

Verification (integer-Kani / float-proptest split):
- Kani DC-K08 verify_read_bits_bounded: the bit-reader is total + every result
  < 2^nbits (the integer floor under esc.Status). 8/8 relay-dronecan harnesses.
- 36 relay-dronecan tests: float16 known IEEE-half vectors + edges; esc.Status
  field decode + rpm sign-extend; mag 3-axis; baro float32; battery prefix; short
  rejects. float16 values + full-decoder totality proptest-fuzzed.

rivet: SWREQ-FALCON-DC-P03 + FV-FALCON-DC-003 (test-level, 12 steps). validate
PASS, 0 gaps. Clean-room 9 confirm (2 env-blocked by a full disk, self-verified).
Plus the PX4-parity roadmap (FEAT-FALCON-v1.96..v1.103: parameter system keystone,
pre-arm checks, calibration, failsafes, position-UX, + backlog wind-est/multi-EKF/
autotune), from the PX4 gap analysis. Scope move: gnss.Fix2 -> v1.95.

Falsification: this release is wrong if a real DroneCAN float16 telemetry value
mis-decodes vs IEEE-754, if a sensor decoder panics on any payload, if read_bits
returns a value >= 2^nbits, or if spar analyze errors / the decode thread misses
its telemetry deadline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@avrabe avrabe merged commit c9aab10 into main Jun 24, 2026
33 checks passed
@avrabe avrabe deleted the feat/falcon-v1.94-dronecan-sensors branch June 24, 2026 04:08
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