feat: add XDR (Transducer Measurements) sentence parser#164
Open
amoutiers wants to merge 1 commit intoAeroRust:mainfrom
Open
feat: add XDR (Transducer Measurements) sentence parser#164amoutiers wants to merge 1 commit intoAeroRust:mainfrom
amoutiers wants to merge 1 commit intoAeroRust:mainfrom
Conversation
XDR is a generic container sentence widely used in marine instrumentation. It carries variable-length groups of transducer readings — barometric pressure, air temperature, rudder angle, humidity, battery voltage, engine data, and more. Each measurement is a group of 4 fields (type, value, units, name), repeatable up to 8 times in a single sentence. Handles real-world edge cases: - Empty name fields (Calypso anemometer) - Empty unit fields (engine hours) - Incomplete trailing quadruplets (graceful stop) - Multiple measurements per sentence (B&G H5000, Airmar 200WX) Feature-gated behind XDR, included in the 'other' category. Partially addresses AeroRust#54.
d621280 to
a31220e
Compare
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.
Summary
Adds support for XDR sentences (Transducer Measurements), resolving part of #54.
XDR is a generic container sentence widely used in marine instrumentation. It carries variable-length groups of transducer readings — barometric pressure, air temperature, rudder angle, humidity, battery voltage, engine data, and more — from a single sentence.
Format
Each measurement is a group of 4 fields (type, value, units, name), repeatable.
Implementation
XdrDatastruct containing aheapless::Vec<XdrMeasurement, 8>XdrMeasurementstruct withtransducer_type(char),value(f64),units(char),name(ArrayString<16>)XDR(included in theothercategory alongside HDT, MDA, MWV, TXT, ZDA)Real-world edge cases handled
Tested against real NMEA logs from B&G, NKE, Airmar, Calypso, and SignalK sources:
$WIXDR,C,022.0,C,,*52(Calypso anemometer)$IIXDR,G,200,,ENGHRS*3E(engine hours)A,-2.3,D,RUDDERTransducer types observed in practice
ACDEGHIPTUMotivation
I'm building a sailing navigation app and needed XDR parsing for on-board weather stations and autopilot transducers. Figured I'd contribute it upstream rather than maintain a custom parser. Happy to follow up with other marine sentences (MWD, RSA, ROT, HDG, etc.) if there's interest.
Partially addresses #54.