MAV'RIC
gps_ublox.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file gps_ublox.h
34  *
35  * \author MAV'RIC Team
36  * \author Nicolas Dousse
37  *
38  * \brief This file decodes the messages from the UBLOX GPS
39  *
40  ******************************************************************************/
41 
42 
43 #ifndef GPS_UBLOX_H__
44 #define GPS_UBLOX_H__
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include "stdint.h"
51 #include "stdbool.h"
52 #include "maths.h"
53 #include "streams.h"
54 #include "buffer.h"
55 #include "uart_int.h"
56 
57 /*
58  * try to put a UBlox into binary mode. This is in two parts. First we
59  * send a PUBX asking the UBlox to receive NMEA and UBX, and send UBX,
60  * with a baudrate of 38400. Then we send a UBX message setting rate 1
61  * for the NAV_SOL message. The setup of NAV_SOL is to cope with
62  * configurations where all UBX binary message types are disabled.
63  * 0001: UBX
64  * 0002: NMEA
65  * 0003: NMEA + UBX
66  */
67 //#define UBLOX_SET_BINARY "$PUBX,41,1,0003,0001,38400,0*26\n\265\142\006\001\003\000\001\006\001\022\117"
68 
69 // changed by ndousse
70 #define UBLOX_SET_BINARY "$PUBX,41,1,0003,0001,38400,0*25\r\n"//\265\142\006\001\003\000\001\006\001\022\117"
71 
72 /*
73 Structure of an UBlox binary message
74 
75 PREAMBLE1 PREAMBLE2 CLASS MSG_ID LENGTH1 LENGTH2 MESSAGE CHECKSUMA CHECKSUMB
76 1 byte 1 byte 1 byte 1 byte Lowest byte Highest byte LENGTH size 1 byte 1 byte
77 
78 The information is received in the Little endian format (least significant byte first).
79 */
80 
81 #define UBX_PREAMBLE1 0xb5
82 #define UBX_PREAMBLE2 0x62
83 
84 /*
85 Name Class Description
86 NAV 0x01 Navigation Results: Position, Speed, Time, Acc, Heading, DOP, SVs used
87 RXM 0x02 Receiver Manager Messages: Satellite Status, RTC Status
88 INF 0x04 Information Messages: Printf-Style Messages, with IDs such as Error, Warning, Notice
89 ACK 0x05 Ack/Nack Messages: as replies to CFG Input Messages
90 CFG 0x06 Configuration Input Messages: Set Dynamic Model, Set DOP Mask, Set Baud Rate, etc.
91 MON 0x0A Monitoring Messages: Comunication Status, CPU Load, Stack Usage, Task Status
92 AID 0x0B AssistNow Aiding Messages: Ephemeris, Almanac, other A-GPS data input
93 TIM 0x0D Timing Messages: Timepulse Output, Timemark Results
94 */
95 #define UBX_CLASS_NAV 0x01
96 #define UBX_CLASS_RXM 0x02
97 #define UBX_CLASS_INF 0x04
98 #define UBX_CLASS_ACK 0x05
99 #define UBX_CLASS_CFG 0x06
100 #define UBX_CLASS_MON 0x0A
101 #define UBX_CLASS_AID 0x0B
102 #define UBX_CLASS_TIM 0x0D
103 #define UBX_CLASS_ESF 0x10
104 
105 // Type of Messages that can be received in each class
106 #define MSG_ACK_NACK 0x00
107 #define MSG_ACK_ACK 0x01
108 
109 #define MSG_INF_ERROR 0x00
110 #define MSG_INF_WARNING 0x01
111 #define MSG_INF_NOTICE 0x02
112 #define MSG_INF_TEST 0x03
113 #define MSG_INF_DEBUG 0x04
114 
115 #define MSG_NAV_POSLLH 0x02
116 #define MSG_NAV_STATUS 0x03
117 #define MSG_NAV_AOPSTATUS 0x60
118 #define MSG_NAV_CLOCK 0x22
119 #define MSG_NAV_SOL 0x06
120 #define MSG_NAV_VELNED 0x12
121 #define MSG_NAV_VELCEF 0x11
122 #define MSG_NAV_TIMEGPS 0x20
123 #define MSG_NAV_TIMEUTC 0x21
124 #define MSG_NAV_SVINFO 0x30
125 
126 #define MSG_CFG_PRT 0x00
127 #define MSG_CFG_RATE 0x08
128 #define MSG_CFG_SET_RATE 0x01
129 #define MSG_CFG_NAV_SETTINGS 0x24
130 #define MSG_CFG_NMEA 0x17
131 
132 #define MSG_MON_RXR 0x21
133 
134 #define MSG_TIM_TP 0x01
135 #define MSG_TIM_VRFY 0x06
136 
137 #define UBX_PLATFORM_PORTABLE 0x00
138 #define UBX_PLATFORM_STATIONARY 0x02
139 #define UBX_PLATFORM_PEDESTRIAN 0x03
140 #define UBX_PLATFORM_AUTO 0x04
141 #define UBX_PLATFORM_SEA 0x05
142 #define UBX_PLATFORM_1GAIR 0x06
143 #define UBX_PLATFORM_2GAIR 0x07
144 #define UBX_PLATFORM_4GAIR 0x08
145 
146 #define GPS_FIX_TYPE_NOFIX 0x00
147 #define GPS_FIX_TYPE_DEADRECK 0x01
148 #define GPS_FIX_TYPE_2DFIX 0x02
149 #define GPS_FIX_TYPE_3DFIX 0x03
150 #define GPS_FIX_TYPE_GPSDEADRECK 0x04
151 #define GPS_FIX_TYPE_TIMEONLY 0x05
152 
153 // For binary message
154 #define UBX_CFG_MSG 0xF1
155 #define UBX_CFG_MSG_ID 0x41
156 
157 // Sizes
158 #define UBX_SIZE_NAV_POSLLH 28
159 #define UBX_SIZE_NAV_STATUS 16
160 #define UBX_SIZE_NAV_SOL 52
161 #define UBX_SIZE_NAV_VELNED 36
162 #define UBX_SIZE_NAV_SVINFO 30 //8 + 12*num_channel
163 #define UBX_SIZE_NAV_SETTINGS 36
164 
165 #define UBX_SIZE_CFG_RATE 6
166 #define UBX_SIZE_CFG_GETSET_RATE 3
167 
168 #define UBX_SIZE_MON_RXR 1
169 
170 #define UBX_SIZE_TIM_TP 16
171 #define UBX_SIZE_TIM_VRFY 20
172 
173 #define NAV_STATUS_FIX_NVALID 0
174 #define NAV_STATUS_FIX_VALID 1
175 
176 //epoch
177 #define TIME_OF_DAY 0 //<
178 #define TIME_OF_WEEK 1 //< Ublox
179 #define TIME_OF_YEAR 2 //< MTK, NMEA
180 #define UNIX_EPOCH 3
181 
182 #define DEG2RAD PI/180
183 
184 // The UART bytes are sent in a little endian format from the GPS, if the processor is big endian, define BIG_ENDIAN
185 // Otherwise comment the following line
186 #define BIG_ENDIAN
187 
188 #ifdef BIG_ENDIAN
189 
192  typedef struct
193  {
194  uint16_t length;
195  uint8_t msg_id_header;
196  uint8_t msg_class;
197  uint8_t preamble2;
198  uint8_t preamble1;
199  }ubx_header_t;
200 
204  typedef struct
205  {
206  uint16_t timeref;
207  uint16_t nav_rate;
208  uint16_t measure_rate_ms;
210 
211  // We still have to send to message in the correct order to the GPS
215  typedef struct
216  {
217  uint16_t measure_rate_ms;
218  uint16_t nav_rate;
219  uint16_t timeref;
221 
225  typedef struct
226  {
227  uint8_t rate;
228  uint8_t msg_id_rate;
229  uint8_t msg_class;
231 
232  // We still have to send to message in the correct order to the GPS
236  typedef struct
237  {
238  uint8_t msg_class;
239  uint8_t msg_id_rate;
240  uint8_t rate;
242 
246  typedef struct
247  {
248  uint32_t res4;
249  uint32_t res3;
250  uint32_t res2;
251  uint8_t dgps_timeout;
253  uint16_t t_acc;
254  uint16_t p_acc;
255  uint16_t t_dop;
256  uint16_t p_dop;
257  uint8_t dr_limit;
258  int8_t min_elev;
259  uint32_t fixed_alt_var;
260  int32_t fixed_alt;
261  uint8_t fix_mode;
262  uint8_t dyn_model;
263  uint16_t mask;
265 
269  typedef struct
270  {
271  uint32_t vertical_accuracy;
273  int32_t altitude_msl;
275  int32_t latitude;
276  int32_t longitude;
277  uint32_t itow;
279 
283  typedef struct
284  {
285  uint32_t uptime;
286  uint32_t time_to_first_fix;
287  uint8_t flags2;
288  uint8_t fix_status;
289  uint8_t flags;
290  uint8_t fix_type;
291  uint32_t itow;
293 
297  typedef struct
298  {
299  uint32_t res2;
300  uint8_t satellites;
301  uint8_t res;
302  uint16_t position_DOP;
303  uint32_t speed_accuracy;
304  int32_t ecef_z_velocity;
305  int32_t ecef_y_velocity;
306  int32_t ecef_x_velocity;
308  int32_t ecef_z;
309  int32_t ecef_y;
310  int32_t ecef_x;
311  uint8_t fix_status;
312  uint8_t fix_type;
313  int16_t week;
314  int32_t time_nsec;
315  uint32_t itow;
317 
321  typedef struct
322  {
323  uint32_t heading_accuracy;
324  uint32_t speed_accuracy;
325  int32_t heading_2d;
326  uint32_t ground_speed_2d;
327  uint32_t speed_3d;
328  int32_t ned_down;
329  int32_t ned_east;
330  int32_t ned_north;
331  uint32_t itow;
333 
337  typedef struct
338  {
342  struct
343  {
344  int32_t pr_res;
345  int16_t azim;
346  int8_t elev;
347  uint8_t cno;
348  uint8_t quality;
349  uint8_t flags;
350  uint8_t svid;
351  uint8_t chn;
352  } channel_data[16];
353 
354  uint16_t reserved;
355  uint8_t global_flags;
356  uint8_t num_ch;
357  uint32_t itow;
359 
363  typedef struct
364  {
365  uint8_t awake_flag;
367 
371  typedef struct
372  {
373  uint8_t res;
374  uint8_t flags;
375  uint16_t week;
376  int32_t q_err;
377  uint32_t tow_sub_ms;
378  uint32_t tow_ms;
379  }ubx_tim_tp_t;
380 
384  typedef struct
385  {
386  uint8_t res;
387  uint8_t flags;
388  uint16_t wno;
389  int32_t delta_ns;
390  int32_t delta_ms;
391  int32_t frac;
392  int32_t itow;
394 
395 #else
396 
400  typedef struct
401  {
402  uint8_t preamble1;
403  uint8_t preamble2;
404  uint8_t msg_class;
405  uint8_t msg_id_header;
406  uint16_t length;
407  }ubx_header_t;
408 
412  typedef struct
413  {
414  uint16_t measure_rate_ms;
415  uint16_t nav_rate;
416  uint16_t timeref;
418 
422  typedef struct
423  {
424  uint8_t msg_class;
425  uint8_t msg_id_rate;
426  uint8_t rate;
428 
432  typedef struct
433  {
434  uint16_t mask;
435  uint8_t dyn_model;
436  uint8_t fix_mode;
437  int32_t fixed_alt;
438  uint32_t fixed_alt_var;
439  int8_t min_elev;
440  uint8_t dr_limit;
441  uint16_t p_dop;
442  uint16_t t_dop;
443  uint16_t p_acc;
444  uint16_t t_acc;
445  uint8_t static_hold_thresh;
446  uint8_t dgps_timeout;
447  uint32_t res2;
448  uint32_t res3;
449  uint32_t res4;
451 
455  typedef struct
456  {
457  uint32_t itow;
458  int32_t longitude;
459  int32_t latitude;
460  int32_t altitude_ellipsoid;
461  int32_t altitude_msl;
462  uint32_t horizontal_accuracy;
463  uint32_t vertical_accuracy;
465 
469  typedef struct
470  {
471  uint32_t itow;
472  uint8_t fix_type;
473  uint8_t flags;
474  uint8_t fix_status;
475  uint8_t flags2;
476  uint32_t time_to_first_fix;
477  uint32_t uptime;
479 
483  typedef struct
484  {
485  uint32_t itow;
486  int32_t time_nsec;
487  int16_t week;
488  uint8_t fix_type;
489  uint8_t fix_status;
490  int32_t ecef_x;
491  int32_t ecef_y;
492  int32_t ecef_z;
493  uint32_t position_accuracy_3d;
494  int32_t ecef_x_velocity;
495  int32_t ecef_y_velocity;
496  int32_t ecef_z_velocity;
497  uint32_t speed_accuracy;
498  uint16_t position_DOP;
499  uint8_t res;
500  uint8_t satellites;
501  uint32_t res2;
503 
507  typedef struct
508  {
509  uint32_t itow;
510  int32_t ned_north;
511  int32_t ned_east;
512  int32_t ned_down;
513  uint32_t speed_3d;
514  uint32_t ground_speed_2d;
515  int32_t heading_2d;
516  uint32_t speed_accuracy;
517  uint32_t heading_accuracy;
519 
523  typedef struct
524  {
525  uint32_t itow;
526  uint8_t num_ch;
527  uint8_t global_flags;
528  uint16_t reserved;
529 
533  struct
534  {
535  uint8_t chn;
536  uint8_t svid;
537  uint8_t flags;
538  uint8_t quality;
539  uint8_t cno;
540  int8_t elev;
541  int16_t azim;
542  int32_t pr_res;
543  } channel_data[16];
545 
549  typedef struct
550  {
551  uint8_t awake_flag;
553 
557  typedef struct
558  {
559  uint32_t tow_ms;
560  uint32_t tow_sub_ms;
561  int32_t q_err;
562  uint16_t week;
563  uint8_t flags;
564  uint8_t res;
565  }ubx_tim_tp_t;
566 
570  typedef struct
571  {
572  int32_t itow;
573  int32_t frac;
574  int32_t delta_ms;
575  int32_t delta_ns;
576  uint16_t wno;
577  uint8_t flags;
578  uint8_t res;
580 
581 #endif
582 
583 ubx_cfg_nav_settings_t nav_settings;
584 
585 uint8_t cksum_a;
586 uint8_t cksum_b;
587 
588 // State machine state
589 uint8_t step;
590 uint8_t msg_id;
591 uint16_t payload_length;
592 uint16_t payload_counter;
593 
594 uint8_t ubx_class;
595 
596 // do we have new position and speed information?
597 bool new_position;
598 bool new_speed;
599 
600 uint8_t disable_counter;
601 
602 bool next_fix;
603 bool have_raw_velocity;
604 
605 #define NO_GPS 0
606 #define NO_FIX 1
607 #define GPS_OK 2
608 
609 typedef enum {
610  GPS_ENGINE_NONE = -1,
611  GPS_ENGINE_PORTABLE = 0,
612  GPS_ENGINE_STATIONARY = 2,
613  GPS_ENGINE_PEDESTRIAN = 3,
614  GPS_ENGINE_AUTOMOTIVE = 4,
615  GPS_ENGINE_SEA = 5,
616  GPS_ENGINE_AIRBORNE_1G = 6,
617  GPS_ENGINE_AIRBORNE_2G = 7,
618  GPS_ENGINE_AIRBORNE_4G = 8
619 }gps_engine_setting_t;
620 
621 gps_engine_setting_t engine_nav_setting;
622 
623 
624 #define UBX_TIMEOUT_CYCLES 2
625 #define UBX_POSITION_PRECISION 20
626 #define UBX_ALTITUDE_PRECISION 20
627 #define UBX_SPEED_PRECISION 5
628 
629 #define UBX_HEADING_PRECISION 5000000
630 
631 
635 typedef struct
636 {
637  double latitude;
638  double longitude;
639  float altitude;
640  float alt_elips;
641  float speed;
642  float ground_speed;
643  float north_speed;
644  float east_speed;
646  float course;
647 
650 
653 
654  uint8_t num_sats;
655  uint16_t hdop;
656 
657  uint32_t time_last_msg;
658  uint32_t time_gps;
659 
660  uint8_t status;
661 
663 
664  uint8_t altitude_status;
665  uint8_t speed_status;
666  uint8_t course_status;
667  uint8_t accuracy_status;
668 
672 } gps_t;
673 
674 
675 uint32_t idle_timer;
676 uint32_t idle_timeout;
677 uint32_t last_fix_time;
678 
679 
687 void gps_ublox_init(gps_t *gps, int32_t UID, usart_config_t usart_conf_gps);
688 
689 
697 void gps_ublox_configure_gps(gps_t *gps);
698 
699 
705 void gps_ublox_update(gps_t *gps);
706 
707 #ifdef __cplusplus
708 }
709 #endif
710 
711 #endif //GPS_UBLOX_H__
The U-Blox CFG_MSG rate structure definition.
Definition: gps_ublox.h:225
uint8_t msg_class
The class of the message.
Definition: gps_ublox.h:196
uint8_t fix_status
Fix status information.
Definition: gps_ublox.h:288
int32_t fixed_alt
Fixed altitude for 2D fix mode in m.
Definition: gps_ublox.h:260
byte_stream_t gps_stream_out
The outgoing GPS byte stream.
Definition: gps_ublox.h:671
The U-Blox header structure definition.
Definition: gps_ublox.h:192
uint8_t fix_mode
Fixing mode, 1:2D, 2:3D, 3:auto 2D/3D.
Definition: gps_ublox.h:261
float vertical_accuracy
Vertical accuracy in m.
Definition: gps_ublox.h:649
uint8_t speed_status
Speed status.
Definition: gps_ublox.h:665
float horizontal_accuracy
Horizontal accuracy in m.
Definition: gps_ublox.h:648
uint32_t res3
Reserved slot.
Definition: gps_ublox.h:249
uint8_t msg_id_rate
The msg id.
Definition: gps_ublox.h:228
float speed
3D speed in m/s
Definition: gps_ublox.h:641
uint32_t itow
GPS msToW.
Definition: gps_ublox.h:357
The U-Blox CFG_NAV rate send structure definition.
Definition: gps_ublox.h:215
uint32_t itow
GPS msToW.
Definition: gps_ublox.h:277
uint8_t quality
Bitmask, see U-Blox 6 documentation.
Definition: gps_ublox.h:348
uint32_t time_to_first_fix
Time to first fix in milliseconds.
Definition: gps_ublox.h:286
uint16_t timeref
The time reference, 0:UTC time, 1:GPS time.
Definition: gps_ublox.h:219
uint16_t nav_rate
The rate.
Definition: gps_ublox.h:218
uint8_t static_hold_thresh
Static hold threshold cm/s.
Definition: gps_ublox.h:252
uint32_t speed_accuracy
Speed accuracy estimate in cm/s.
Definition: gps_ublox.h:303
uint32_t res2
Reserved slot.
Definition: gps_ublox.h:250
uint32_t time_last_msg
Time reference in ms of microcontroller.
Definition: gps_ublox.h:657
uint8_t msg_class
The msg class.
Definition: gps_ublox.h:238
int32_t delta_ns
Sub-millisecond part of delta time.
Definition: gps_ublox.h:389
float east_speed
The speed to the east in m/s.
Definition: gps_ublox.h:644
uint32_t res4
Reserved slot.
Definition: gps_ublox.h:248
int32_t ecef_x
Earth centered, earth frame, x coordinate in cm.
Definition: gps_ublox.h:310
byte_stream_t gps_stream_in
The incoming GPS byte stream.
Definition: gps_ublox.h:670
uint8_t fix_type
The fix type.
Definition: gps_ublox.h:312
uint8_t svid
Satellite ID.
Definition: gps_ublox.h:350
int32_t frac
Sub-millisecond part of ToW in ns.
Definition: gps_ublox.h:391
uint8_t flags
Nav status flag.
Definition: gps_ublox.h:289
uint32_t position_accuracy_3d
3D position accuracy estimate in cm
Definition: gps_ublox.h:307
uint8_t preamble1
The 1st preamble of the message.
Definition: gps_ublox.h:198
uint16_t mask
Bitmask, see U-Blox 6 documentation.
Definition: gps_ublox.h:263
int16_t week
GPS week (GPS time)
Definition: gps_ublox.h:313
uint16_t t_acc
Time accuracy mask in m.
Definition: gps_ublox.h:253
int32_t latitude
Latitude in deg 1e-7.
Definition: gps_ublox.h:275
uint8_t msg_class
The msg_class.
Definition: gps_ublox.h:229
uint16_t wno
Week number.
Definition: gps_ublox.h:388
int32_t altitude_msl
Height above mean sea level in mm.
Definition: gps_ublox.h:273
The U-Blox NAV-SOL message structure definition.
Definition: gps_ublox.h:297
uint16_t reserved
Reserved slot.
Definition: gps_ublox.h:354
The U-Blox TIM-VRFY message structure definition.
Definition: gps_ublox.h:384
int32_t delta_ms
Inter ms of delta time.
Definition: gps_ublox.h:390
Buffer structure.
Definition: buffer.h:61
int32_t itow
Integer ms ToW received by source.
Definition: gps_ublox.h:392
uint8_t msg_id_header
The msg id header.
Definition: gps_ublox.h:195
uint8_t flags
Aiding time source, 0:no time aiding done, 2:source was RTC, 3:source was AID-INI.
Definition: gps_ublox.h:387
uint8_t num_ch
Number of channels.
Definition: gps_ublox.h:356
uint32_t heading_accuracy
Course/heading estimate accuracy in deg 1e-5.
Definition: gps_ublox.h:323
uint8_t horizontal_status
Horizontal status.
Definition: gps_ublox.h:662
int32_t q_err
Quantization error of timepulse.
Definition: gps_ublox.h:376
The U-Blox NAV-VELNED message structure definition.
Definition: gps_ublox.h:321
double longitude
Longitude in degrees.
Definition: gps_ublox.h:638
uint8_t chn
GPS msToW.
Definition: gps_ublox.h:351
uint8_t status
GPS status.
Definition: gps_ublox.h:660
int16_t azim
Azimuth in integer degrees.
Definition: gps_ublox.h:345
uint8_t flags
Bitmask, 0,1:gps timebase, UTC not available, 2,3:UTC timebase, UTC available.
Definition: gps_ublox.h:374
The U-Blox MON-RXR message structure definition.
Definition: gps_ublox.h:363
uint8_t res
Reserved slot.
Definition: gps_ublox.h:386
int32_t ecef_y
Earth centered, earth frame, y coordinate in cm.
Definition: gps_ublox.h:309
uint8_t flags2
Information about navigatio output.
Definition: gps_ublox.h:287
uint8_t flags
Bitmask, see U-Blox 6 documentation.
Definition: gps_ublox.h:349
buffer_t gps_buffer
The GPS buffer.
Definition: gps_ublox.h:669
uint8_t rate
The rate.
Definition: gps_ublox.h:227
uint16_t measure_rate_ms
The measure rate of the cfg_nav message in ms.
Definition: gps_ublox.h:208
int32_t ecef_z_velocity
Earth centered, earth frame, z velocity coordinate in cm/s.
Definition: gps_ublox.h:304
uint32_t tow_sub_ms
Sumbmillisecond part of ToWms scaling: 2^-32.
Definition: gps_ublox.h:377
uint32_t fixed_alt_var
Fixed altitude variance in 2D mode in m^2.
Definition: gps_ublox.h:259
int32_t ecef_z
Earth centered, earth frame, z coordinate in cm.
Definition: gps_ublox.h:308
int32_t ned_east
NED East velocity in cm/s.
Definition: gps_ublox.h:329
The U-Blox NAV-STATUS message structure definition.
Definition: gps_ublox.h:283
Type definition for GPS data.
Definition: gps_ublox.h:635
uint8_t fix_status
The fix status.
Definition: gps_ublox.h:311
int8_t elev
Elevation in integer degrees.
Definition: gps_ublox.h:346
float heading_accuracy
Heading accuracy in m.
Definition: gps_ublox.h:652
uint8_t rate
The rate of the message id.
Definition: gps_ublox.h:240
uint32_t ground_speed_2d
Ground speed in cm/s.
Definition: gps_ublox.h:326
int32_t ecef_y_velocity
Earth centered, earth frame, y velocity coordinate in cm/s.
Definition: gps_ublox.h:305
uint32_t vertical_accuracy
Vertical accuracy in mm.
Definition: gps_ublox.h:271
uint16_t nav_rate
The rate.
Definition: gps_ublox.h:207
uint32_t speed_3d
3D speed in cm/s
Definition: gps_ublox.h:327
uint32_t uptime
Milliseconds since startup.
Definition: gps_ublox.h:285
int32_t longitude
Longitude in deg 1e-7.
Definition: gps_ublox.h:276
uint32_t time_gps
Time reference in ms of gps.
Definition: gps_ublox.h:658
int8_t min_elev
Minimum elevation for a GNSS satellite to be used in NAV in deg.
Definition: gps_ublox.h:258
uint16_t p_acc
Position accuracy mask in m.
Definition: gps_ublox.h:254
uint32_t horizontal_accuracy
Horizontal accuracy in mm.
Definition: gps_ublox.h:272
uint8_t global_flags
Bitmask, 0:antaris, 1:u-blox 5, 2:u-blox 6.
Definition: gps_ublox.h:355
The U-Blox CFG_NAV structure definition.
Definition: gps_ublox.h:204
uint16_t week
Timepulse week number according to timebase.
Definition: gps_ublox.h:375
uint8_t altitude_status
Altitude status.
Definition: gps_ublox.h:664
uint8_t accuracy_status
Accuracy status.
Definition: gps_ublox.h:667
float vertical_speed
The vertical speed in m/s.
Definition: gps_ublox.h:645
uint8_t dyn_model
UBX_PLATFORM_... type.
Definition: gps_ublox.h:262
int32_t altitude_ellipsoid
Height above ellipsoid in mm.
Definition: gps_ublox.h:274
int32_t time_nsec
Fractional nanoseconds remainder of rounded ms above.
Definition: gps_ublox.h:314
uint8_t res
Unused.
Definition: gps_ublox.h:373
uint16_t p_dop
Position DOP mask to use.
Definition: gps_ublox.h:256
uint32_t res2
Reserved slot.
Definition: gps_ublox.h:299
float alt_elips
Altitude above ellipsoid in m.
Definition: gps_ublox.h:640
uint8_t awake_flag
Receiver status flag.
Definition: gps_ublox.h:365
Byte stream.
Definition: streams.h:62
uint32_t itow
GPS msToW.
Definition: gps_ublox.h:331
The U-Blox CFG_MSG rate send structure definition.
Definition: gps_ublox.h:236
The U-Blox NAV-SVINFO message structure definition.
Definition: gps_ublox.h:337
float ground_speed
2D ground speed in m/s
Definition: gps_ublox.h:642
uint8_t res
Reserved slot.
Definition: gps_ublox.h:301
uint8_t cno
Carrier to Noise ratio in dbHz.
Definition: gps_ublox.h:347
uint16_t t_dop
Time DOP mask to use.
Definition: gps_ublox.h:255
uint8_t num_sats
Number of visible satellites.
Definition: gps_ublox.h:654
uint8_t dr_limit
Maximum time to perform dead reckoning in case of GPS signal loos, in sec.
Definition: gps_ublox.h:257
uint8_t fix_type
Fix type.
Definition: gps_ublox.h:290
int32_t heading_2d
Heading of motion in deg 1e-5.
Definition: gps_ublox.h:325
uint16_t hdop
Height DOP.
Definition: gps_ublox.h:655
The U-Blox TIM-TP message structure definition.
Definition: gps_ublox.h:371
int32_t ecef_x_velocity
Earth centered, earth frame, x velocity coordinate in cm/s.
Definition: gps_ublox.h:306
The U-Blox CFG_NAV settings structure definition.
Definition: gps_ublox.h:246
uint16_t measure_rate_ms
The measure_rate.
Definition: gps_ublox.h:217
float altitude
Altitude in m.
Definition: gps_ublox.h:639
uint8_t msg_id_rate
The msg id.
Definition: gps_ublox.h:239
int32_t pr_res
Pseudo range in residual in centimeters.
Definition: gps_ublox.h:344
The U-Blox NAV-POSLLH message structure definition.
Definition: gps_ublox.h:269
uint16_t position_DOP
Position DOP, scaling 0.01f.
Definition: gps_ublox.h:302
uint16_t timeref
The time reference.
Definition: gps_ublox.h:206
uint32_t tow_ms
Timepulse time of week according to time base in ms.
Definition: gps_ublox.h:378
uint8_t course_status
Course status.
Definition: gps_ublox.h:666
uint16_t length
The length of the message.
Definition: gps_ublox.h:194
uint32_t speed_accuracy
Speed accuracy estimate cm/s.
Definition: gps_ublox.h:324
UART configuration structure.
Definition: uart_int.h:80
int32_t ned_down
NED Down velocity in cm/s.
Definition: gps_ublox.h:328
float course
Heading in degree * 100.
Definition: gps_ublox.h:646
float north_speed
The speed to the north in m/s.
Definition: gps_ublox.h:643
uint8_t preamble2
The 2nd preamble of the message.
Definition: gps_ublox.h:197
uint8_t satellites
Number of of SVs used in Nav solution.
Definition: gps_ublox.h:300
int32_t ned_north
NED North velocity in cm/s.
Definition: gps_ublox.h:330
float speed_accuracy
Speed accuracy in m.
Definition: gps_ublox.h:651
uint32_t itow
GPS msToW.
Definition: gps_ublox.h:291
uint32_t itow
GPS msToW.
Definition: gps_ublox.h:315
uint8_t dgps_timeout
DGPS timeout in sec.
Definition: gps_ublox.h:251
double latitude
Latitude in degrees.
Definition: gps_ublox.h:637