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"
81 #define UBX_PREAMBLE1 0xb5
82 #define UBX_PREAMBLE2 0x62
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
106 #define MSG_ACK_NACK 0x00
107 #define MSG_ACK_ACK 0x01
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
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
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
132 #define MSG_MON_RXR 0x21
134 #define MSG_TIM_TP 0x01
135 #define MSG_TIM_VRFY 0x06
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
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
154 #define UBX_CFG_MSG 0xF1
155 #define UBX_CFG_MSG_ID 0x41
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
165 #define UBX_SIZE_CFG_RATE 6
166 #define UBX_SIZE_CFG_GETSET_RATE 3
168 #define UBX_SIZE_MON_RXR 1
170 #define UBX_SIZE_TIM_TP 16
171 #define UBX_SIZE_TIM_VRFY 20
173 #define NAV_STATUS_FIX_NVALID 0
174 #define NAV_STATUS_FIX_VALID 1
177 #define TIME_OF_DAY 0 //<
178 #define TIME_OF_WEEK 1 //< Ublox
179 #define TIME_OF_YEAR 2 //< MTK, NMEA
182 #define DEG2RAD PI/180
405 uint8_t msg_id_header;
414 uint16_t measure_rate_ms;
438 uint32_t fixed_alt_var;
445 uint8_t static_hold_thresh;
446 uint8_t dgps_timeout;
460 int32_t altitude_ellipsoid;
461 int32_t altitude_msl;
462 uint32_t horizontal_accuracy;
463 uint32_t vertical_accuracy;
476 uint32_t time_to_first_fix;
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;
514 uint32_t ground_speed_2d;
516 uint32_t speed_accuracy;
517 uint32_t heading_accuracy;
527 uint8_t global_flags;
591 uint16_t payload_length;
592 uint16_t payload_counter;
600 uint8_t disable_counter;
603 bool have_raw_velocity;
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,
616 GPS_ENGINE_AIRBORNE_1G = 6,
617 GPS_ENGINE_AIRBORNE_2G = 7,
618 GPS_ENGINE_AIRBORNE_4G = 8
619 }gps_engine_setting_t;
621 gps_engine_setting_t engine_nav_setting;
624 #define UBX_TIMEOUT_CYCLES 2
625 #define UBX_POSITION_PRECISION 20
626 #define UBX_ALTITUDE_PRECISION 20
627 #define UBX_SPEED_PRECISION 5
629 #define UBX_HEADING_PRECISION 5000000
676 uint32_t idle_timeout;
677 uint32_t last_fix_time;
697 void gps_ublox_configure_gps(
gps_t *gps);
705 void gps_ublox_update(
gps_t *gps);
711 #endif //GPS_UBLOX_H__
The U-Blox CFG_MSG rate structure definition.
Definition: gps_ublox.h:225
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
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
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 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
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 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