Struct GnssData

Source
pub struct GnssData {
    pub time: Option<String>,
    pub latitude: Option<f64>,
    pub longitude: Option<f64>,
    pub fix_quality: Option<u8>,
    pub num_satellites: Option<u8>,
    pub altitude: Option<f64>,
    pub speed_knots: Option<f64>,
    pub track_angle: Option<f64>,
    pub date: Option<String>,
    pub systems: HashMap<&'static str, GnssSystemData>,
    pub fused_position: Option<FusedPosition>,
}
Expand description

Main GNSS data structure holding parsed information and fused position.

Fields§

§time: Option<String>

UTC time from NMEA sentence

§latitude: Option<f64>

Latitude in decimal degrees

§longitude: Option<f64>

Longitude in decimal degrees

§fix_quality: Option<u8>

Fix quality indicator

§num_satellites: Option<u8>

Number of satellites used for fix

§altitude: Option<f64>

Altitude above mean sea level in meters

§speed_knots: Option<f64>

Speed over ground in knots

§track_angle: Option<f64>

Track angle in degrees

§date: Option<String>

Date in DDMMYY format

§systems: HashMap<&'static str, GnssSystemData>

Data for each GNSS system

§fused_position: Option<FusedPosition>

Fused position calculated from available systems

Implementations§

Source§

impl GnssData

Source

pub fn new() -> Self

Creates a new GnssData instance with all supported GNSS systems initialized.

§Example
use nema_parser::gnss_multignss_parser::GnssData;

let gnss = GnssData::new();
Source

pub fn feed_nmea(&mut self, sentence: &str)

Feeds a single NMEA sentence to the parser and updates internal state.

§Arguments
  • sentence - A string slice containing the NMEA sentence.
§Example
use nema_parser::gnss_multignss_parser::GnssData;
let mut gnss = GnssData::new();
gnss.feed_nmea("$GNGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47");
Source

pub fn calculate_fused_position(&mut self)

Calculates a fused position from all available GNSS systems using weighted averaging.

The fused position is stored in self.fused_position.

§Example
use nema_parser::gnss_multignss_parser::GnssData;
let mut gnss = GnssData::new();
gnss.calculate_fused_position();
if let Some(fused) = &gnss.fused_position {
    println!("Fused position: {}, {}", fused.latitude, fused.longitude);
}
Source

pub fn calculate_advanced_fused_position(&mut self)

Calculates an advanced fused position using a Kalman-like filtering approach.

The fused position is stored in self.fused_position.

Trait Implementations§

Source§

impl Clone for GnssData

Source§

fn clone(&self) -> GnssData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GnssData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GnssData

Source§

fn default() -> GnssData

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.