pub struct GPSData {}Expand description
Data from the gps device.
Fields§
§mode: FixNMEA mode: 0=unknown, 1=no fix, 2=2D, 3=3D.
sats: u8The number of satellites received by the GPS unit
sats_valid: u8The number of satellites with valid information.
lon: f64Longitude in degrees.
lat: f64Latitude in degrees
alt_hae: f64Altitude, height above ellipsoid, in meters.
alt_msl: f64MSL Altitude in meters. The geoid used is rarely specified and is often inaccurate.
alt: f32Deprecated. Altitude in meters. Use altHAE or altMSL.
track: f32Course over ground, degrees from true north
speed: f32Speed over ground, meters per second
climb: f32Climb (positive) or sink (negative) rate, meters per second
time: StringTime/date stamp in ISO8601 format, UTC. May have a fractional part of up to .001sec precision.
epc: f32Climb/sink error estimate in meters/sec, 95% confidence.
eps: f32Speed error estimated in meters/sec, 95% confidence.
ept: f32Estimated timestamp error (%f, seconds, 95% confidence).
epv: f32Estimated vertical error in meters, 95% confidence. Present if mode is 3 and DOPs can be calculated from the satellite view.
epx: f32Longitude error estimate in meters, 95% confidence. Present if mode is 2 or 3 and DOPs can be calculated from the satellite view.
epy: f32Latitude error estimate in meters, 95% confidence. Present if mode is 2 or 3 and DOPs can be calculated from the satellite view.
Implementations§
Source§impl GPSData
impl GPSData
Sourcepub fn convert_speed(&self, mph: bool) -> f32
pub fn convert_speed(&self, mph: bool) -> f32
Converts the speed from the gps device to miles per hour or kilometers per hour. If mph is true then it’s mph else it’s km/h.
Sourcepub fn travel_direction(&self) -> String
pub fn travel_direction(&self) -> String
Converts the track/heading of travel to the direction N, NE, E, SE, S, SW, W, NW.