pub struct Position {Show 23 fields
pub latitude_i: Option<i32>,
pub longitude_i: Option<i32>,
pub altitude: Option<i32>,
pub time: u32,
pub location_source: i32,
pub altitude_source: i32,
pub timestamp: u32,
pub timestamp_millis_adjust: i32,
pub altitude_hae: Option<i32>,
pub altitude_geoidal_separation: Option<i32>,
pub pdop: u32,
pub hdop: u32,
pub vdop: u32,
pub gps_accuracy: u32,
pub ground_speed: Option<u32>,
pub ground_track: Option<u32>,
pub fix_quality: u32,
pub fix_type: u32,
pub sats_in_view: u32,
pub sensor_id: u32,
pub next_update: u32,
pub seq_number: u32,
pub precision_bits: u32,
}Expand description
A GPS Position
Fields§
§latitude_i: Option<i32>The new preferred location encoding, multiply by 1e-7 to get degrees in floating point
longitude_i: Option<i32>TODO: REPLACE
altitude: Option<i32>In meters above MSL (but see issue #359)
time: u32This is usually not sent over the mesh (to save space), but it is sent from the phone so that the local device can set its time if it is sent over the mesh (because there are devices on the mesh without GPS or RTC). seconds since 1970
location_source: i32TODO: REPLACE
altitude_source: i32TODO: REPLACE
timestamp: u32Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds
timestamp_millis_adjust: i32Pos. timestamp milliseconds adjustment (rarely available or required)
altitude_hae: Option<i32>HAE altitude in meters - can be used instead of MSL altitude
altitude_geoidal_separation: Option<i32>Geoidal separation in meters
pdop: u32Horizontal, Vertical and Position Dilution of Precision, in 1/100 units
- PDOP is sufficient for most cases
- for higher precision scenarios, HDOP and VDOP can be used instead, in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2)) TODO: REMOVE/INTEGRATE
hdop: u32TODO: REPLACE
vdop: u32TODO: REPLACE
gps_accuracy: u32GPS accuracy (a hardware specific constant) in mm multiplied with DOP to calculate positional accuracy Default: “’bout three meters-ish” :)
ground_speed: Option<u32>Ground speed in m/s and True North TRACK in 1/100 degrees Clarification of terms:
- “track” is the direction of motion (measured in horizontal plane)
- “heading” is where the fuselage points (measured in horizontal plane)
- “yaw” indicates a relative rotation about the vertical axis TODO: REMOVE/INTEGRATE
ground_track: Option<u32>TODO: REPLACE
fix_quality: u32GPS fix quality (from NMEA GxGGA statement or similar)
fix_type: u32GPS fix type 2D/3D (from NMEA GxGSA statement)
sats_in_view: u32GPS “Satellites in View” number
sensor_id: u32Sensor ID - in case multiple positioning sensors are being used
next_update: u32Estimated/expected time (in seconds) until next update:
- if we update at fixed intervals of X seconds, use X
- if we update at dynamic intervals (based on relative movement etc), but “AT LEAST every Y seconds”, use Y
seq_number: u32A sequence number, incremented with each Position message to help detect lost updates if needed
precision_bits: u32Indicates the bits of precision set by the sending node
Implementations§
Source§impl Position
impl Position
Sourcepub fn latitude_i(&self) -> i32
pub fn latitude_i(&self) -> i32
Returns the value of latitude_i, or the default value if latitude_i is unset.
Sourcepub fn longitude_i(&self) -> i32
pub fn longitude_i(&self) -> i32
Returns the value of longitude_i, or the default value if longitude_i is unset.
Sourcepub fn altitude(&self) -> i32
pub fn altitude(&self) -> i32
Returns the value of altitude, or the default value if altitude is unset.
Sourcepub fn location_source(&self) -> LocSource
pub fn location_source(&self) -> LocSource
Returns the enum value of location_source, or the default if the field is set to an invalid enum value.
Sourcepub fn set_location_source(&mut self, value: LocSource)
pub fn set_location_source(&mut self, value: LocSource)
Sets location_source to the provided enum value.
Sourcepub fn altitude_source(&self) -> AltSource
pub fn altitude_source(&self) -> AltSource
Returns the enum value of altitude_source, or the default if the field is set to an invalid enum value.
Sourcepub fn set_altitude_source(&mut self, value: AltSource)
pub fn set_altitude_source(&mut self, value: AltSource)
Sets altitude_source to the provided enum value.
Sourcepub fn altitude_hae(&self) -> i32
pub fn altitude_hae(&self) -> i32
Returns the value of altitude_hae, or the default value if altitude_hae is unset.
Sourcepub fn altitude_geoidal_separation(&self) -> i32
pub fn altitude_geoidal_separation(&self) -> i32
Returns the value of altitude_geoidal_separation, or the default value if altitude_geoidal_separation is unset.
Sourcepub fn ground_speed(&self) -> u32
pub fn ground_speed(&self) -> u32
Returns the value of ground_speed, or the default value if ground_speed is unset.
Sourcepub fn ground_track(&self) -> u32
pub fn ground_track(&self) -> u32
Returns the value of ground_track, or the default value if ground_track is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for Position
impl Message for Position
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.