ublox/ubx_packets/packets/nav_pvt/
proto14.rs

1#[cfg(feature = "serde")]
2use super::super::SerializeUbxPacketFields;
3#[cfg(feature = "serde")]
4use crate::serde::ser::SerializeMap;
5
6use super::common::*;
7use crate::{error::ParserError, GnssFixType, UbxPacketMeta};
8use ublox_derive::ubx_packet_recv;
9
10/// Navigation Position Velocity Time Solution
11#[ubx_packet_recv]
12#[ubx(class = 1, id = 0x07, fixed_payload_len = 84)]
13struct NavPvt {
14    /// GPS Millisecond time of week of the navigation epoch.
15    ///
16    /// Messages with the same iTOW value can be assumed to have come from the same navigation solution.
17    ///
18    /// # Note
19    ///
20    /// iTOW values may not be valid (i.e. they may have been generated with insufficient
21    /// conversion data) and therefore it is not recommended to use the iTOW field for any other purpose.
22    itow: u32,
23
24    /// Year (UTC)
25    year: u16,
26    /// Month, range 1..12 (UTC)
27    month: u8,
28    /// Day of month, range 1..31 (UTC)
29    day: u8,
30    /// Hour of day, range 0..23 (UTC)
31    hour: u8,
32    /// Minute of hour, range 0..59 (UTC)
33    min: u8,
34    /// Seconds of minute, range 0..60 (UTC)
35    sec: u8,
36
37    /// Validity flags, see [NavPvtValidFlags]
38    #[ubx(map_type = NavPvtValidFlags)]
39    valid: u8,
40
41    /// Time accuracy estimate in nanoseconds (UTC)
42    time_accuracy: u32,
43
44    /// Fraction of second, range -1e9 .. 1e9 (UTC)
45    nanosec: i32,
46
47    /// GNSS Fix Type, see [GnssFixType]
48    #[ubx(map_type = GnssFixType)]
49    fix_type: u8,
50
51    /// Fix status flags, see [NavPvtFlags]
52    #[ubx(map_type = NavPvtFlags)]
53    flags: u8,
54
55    reserved1: u8,
56
57    /// Number of satellites used in Nav Solution
58    num_satellites: u8,
59
60    /// Longitude in \[deg\]
61    #[ubx(map_type = f64, scale = 1e-7, alias = longitude)]
62    lon: i32,
63
64    /// Latitude in \[deg\]
65    #[ubx(map_type = f64, scale = 1e-7, alias = latitude)]
66    lat: i32,
67
68    /// Height above reference ellipsoid in \[m\]
69    #[ubx(map_type = f64, scale = 1e-3, alias = height_above_ellipsoid)]
70    height: i32,
71
72    /// Height above Mean Sea Level in \[m\]
73    #[ubx(map_type = f64, scale = 1e-3)]
74    height_msl: i32,
75
76    /// Horizontal accuracy in \[m\]
77    #[ubx(map_type = f64, scale = 1e-3, alias = horizontal_accuracy )]
78    h_acc: u32,
79
80    /// Vertical accuracy in \[m\]
81    #[ubx(map_type = f64, scale = 1e-3, alias = vertical_accuracy )]
82    v_acc: u32,
83
84    /// Velocity North component \[m/s\]
85    #[ubx(map_type = f64, scale = 1e-3)]
86    vel_north: i32,
87
88    /// Velocity East component \[m/s\]
89    #[ubx(map_type = f64, scale = 1e-3)]
90    vel_east: i32,
91
92    /// Velocity Down component \[m/s\]
93    #[ubx(map_type = f64, scale = 1e-3)]
94    vel_down: i32,
95
96    /// Ground speed \[m/s\]
97    #[ubx(map_type = f64, scale = 1e-3, alias = ground_speed_2d)]
98    g_speed: i32,
99
100    /// Heading of motion 2-D \[deg\]
101    #[ubx(map_type = f64, scale = 1e-5, alias = heading_motion)]
102    head_motion: i32,
103
104    /// Speed Accuracy Estimate \[m/s\]
105    #[ubx(map_type = f64, scale = 1e-3, alias = speed_accuracy)]
106    s_acc: u32,
107
108    /// Heading accuracy estimate (for both vehicle and motion) \[deg\]
109    #[ubx(map_type = f64, scale = 1e-5, alias = heading_accuracy)]
110    head_acc: u32,
111
112    /// Position DOP
113    #[ubx(map_type = f64, scale = 1e-2)]
114    pdop: u16,
115
116    reserved2: [u8; 2],
117    reserved3: [u8; 4],
118}