ublox.h
Go to the documentation of this file.
1 #ifndef UBLOX_H
2 #define UBLOX_H
3 
4 #define UBLOX_BUFFER_SIZE 128
5 
6 #include <stdint.h>
7 #include <string>
8 #include <vector>
9 
10 #include "uart.h"
11 
12 #include <iostream>
13 
14 
15 class UBLOX
16 {
17 public:
18  UBLOX();
19  //The majority of the enums and structs below were auto generated from the documentation
20  enum //Fix types
21  {
24  FIX_TYPE_2D = 0x02,
25  FIX_TYPE_3D = 0x03,
28  };
29 
30  enum // Start Bytes
31  {
32  START_BYTE_1 = 0xB5,
33  START_BYTE_2 = 0x62,
34  };
35 
36  enum // NMEA Start Bytes
37  {
40  };
41 
42  enum // Message Classes
43  {
44  CLASS_NAV = 0x01, // Navigation Results Messages: Position, Speed, Time, Acceleration, Heading, DOP, SVs used
45  CLASS_RXM = 0x02, // Receiver Manager Messages: Satellite Status, RTC Status
46  CLASS_INF = 0x04, // Information Messages: Printf-Style Messages, with IDs such as Error, Warning, Notice
47  CLASS_ACK = 0x05, // Ack/Nak Messages: Acknowledge or Reject messages to CFG input messages
48  CLASS_CFG = 0x06, // Configuration Input Messages: Set Dynamic Model, Set DOP Mask, Set Baud Rate, etc.
49  CLASS_UPD = 0x09, // Firmware Update Messages: Memory/Flash erase/write, Reboot, Flash identification, etc.
50  CLASS_MON = 0x0A, // Monitoring Messages: Communication Status, CPU Load, Stack Usage, Task Status
51  CLASS_AID = 0x0B, // AssistNow Aiding Messages: Ephemeris, Almanac, other A-GPS data input
52  CLASS_TIM = 0x0D, // Timing Messages: Time Pulse Output, Time Mark Results
53  CLASS_ESF = 0x10, // External Sensor Fusion Messages: External Sensor Measurements and Status Information
54  CLASS_MGA = 0x13, // Multiple GNSS Assistance Messages: Assistance data for various GNSS
55  CLASS_LOG = 0x21, // Logging Messages: Log creation, deletion, info and retrieva
56  };
57 
58  enum // Ack/Nack
59  {
60  ACK_ACK = 0x01, // Message Acknowledged
61  ACK_NACK = 0x00, // Message Not-Acknowledged
62  };
63 
64  enum // AID enums
65  {
66  AID_ALM = 0x30, // Poll GPS Aiding Almanac Data
67  AID_AOP = 0x33, // AssistNow Autonomous data
68  AID_EPH = 0x31, // GPS Aiding Ephemeris Input/Output Message
69  AID_HUI = 0x02, // Poll GPS Health, UTC, ionosphere parameters
70  AID_INI = 0x01, // Aiding position, time, frequency, clock drift
71  };
72 
73  enum // CFG Message ID's
74  {
75  CFG_ANT = 0x13, // Get/Set Antenna Control Settings
76  CFG_BATCH = 0x93, // Get/Set Get/Set data batching configuration
77  CFG_CFG = 0x09, // Command Clear, Save and Load configurations
78  CFG_DAT = 0x06, // Get The currently defined Datum
79  CFG_DGNSS = 0x70, // Get/Set DGNSS configuration
80  CFG_DOSC = 0x61, // Get/Set Disciplined oscillator configuration
81  CFG_DYNSEED = 0x85, // Set Programming the dynamic seed for the host...
82  CFG_ESRC = 0x60, // Get/Set External synchronization source configuration
83  CFG_FIXSEED = 0x84, // Set Programming the fixed seed for host...
84  CFG_GEOFENCE = 0x69,// Get/Set Geofencing configuration
85  CFG_GNSS = 0x3E, // Get/Set GNSS system configuration
86  CFG_HNR = 0x5C, // Get/Set High Navigation Rate Settings
87  CFG_INF = 0x02, // Poll Request Poll configuration for one protocol
88  CFG_ITFM = 0x39, // Get/Set Jamming/Interference Monitor configuration
89  CFG_LOGFILTER = 0x47,// Get/Set Data Logger Configuration
90  CFG_MSG = 0x01, // Poll Request Poll a message configuration
91  CFG_NAV5 = 0x24, // Get/Set Navigation Engine Settings
92  CFG_NAVX5 = 0x23, // Get/Set Navigation Engine Expert Settings
93  CFG_NMEA = 0x17, // Get/Set NMEA protocol configuration (deprecated)
94  CFG_ODO = 0x1E, // Get/Set Odometer, Low_speed COG Engine Settings
95  CFG_PM2 = 0x3B, // Get/Set Extended Power Management configuration
96  CFG_PMS = 0x86, // Get/Set Power Mode Setup
97  CFG_PRT = 0x00, // Poll Request Polls the configuration for one I/O Port
98  CFG_PWR = 0x57, // Set Put receiver in a defined power state.
99  CFG_RATE = 0x08, // Get/Set Navigation/Measurement Rate Settings
100  CFG_RINV = 0x34, // Get/Set Contents of Remote Inventory
101  CFG_RST = 0x04, // Command Reset Receiver / Clear Backup Data Structures
102  CFG_RXM = 0x11, // Get/Set RXM configuration
103  CFG_SBAS = 0x16, // Get/Set SBAS Configuration
104  CFG_SMGR = 0x62, // Get/Set Synchronization manager configuration
105  CFG_TMODE2 = 0x3D, // Get/Set Time Mode Settings 2
106  CFG_TMODE3 = 0x71, // Get/Set Time Mode Settings 3
107  CFG_TP5 = 0x31, // Poll Request Poll Time Pulse Parameters for Time Pulse 0
108  CFG_TXSLOT = 0x53, // Set TX buffer time slots configuration
109  CFG_USB = 0x1B, // Get/Set USB Configuration
110  };
111 
112  enum // NAV Message ID's
113  {
114  NAV_AOPSTATUS = 0x60, // Periodic/Polled AssistNow Autonomous Status
115  NAV_ATT = 0x05, // Periodic/Polled Attitude Solution
116  NAV_CLOCK = 0x22, // Periodic/Polled Clock Solution
117  NAV_DGPS = 0x31, // Periodic/Polled DGPS Data Used for NAV
118  NAV_DOP = 0x04, // Periodic/Polled Dilution of precision
119  NAV_EOE = 0x61, // Periodic End Of Epoch
120  NAV_GEOFENCE = 0x39, // Periodic/Polled Geofencing status
121  NAV_HPPOSECEF = 0x13, // Periodic/Polled High Precision Position Solution in ECEF
122  NAV_HPPOSLLH = 0x14, // Periodic/Polled High Precision Geodetic Position Solution
123  NAV_ODO = 0x09, // Periodic/Polled Odometer Solution
124  NAV_ORB = 0x34, // Periodic/Polled GNSS Orbit Database Info
125  NAV_POSECEF = 0x01, // Periodic/Polled Position Solution in ECEF
126  NAV_POSLLH = 0x02, // Periodic/Polled Geodetic Position Solution
127  NAV_PVT = 0x07, // Periodic/Polled Navigation Position Velocity Time Solution
128  NAV_RELPOSNED = 0x3C, // Periodic/Polled Relative Positioning Information in NED frame
129  NAV_RESETODO = 0x10, // Command Reset odometer
130  NAV_SAT = 0x35, // Periodic/Polled Satellite Information
131  NAV_SBAS = 0x32, // Periodic/Polled SBAS Status Data
132  NAV_SOL = 0x06, // Periodic/Polled Navigation Solution Information
133  NAV_STATUS = 0x03, // Periodic/Polled Receiver Navigation Status
134  NAV_SVINFO = 0x30, // Periodic/Polled Space Vehicle Information
135  NAV_SVIN = 0x3B, // Periodic/Polled Survey-in data
136  NAV_TIMEBDS = 0x24, // Periodic/Polled BDS Time Solution
137  NAV_TIMEGAL = 0x25, // Periodic/Polled Galileo Time Solution
138  NAV_TIMEGLO = 0x23, // Periodic/Polled GLO Time Solution
139  NAV_TIMEGPS = 0x20, // Periodic/Polled GPS Time Solution
140  NAV_TIMELS = 0x26, // Periodic/Polled Leap second event information
141  NAV_TIMEUTC = 0x21, // Periodic/Polled UTC Time Solution
142  NAV_VELECEF = 0x11, // Periodic/Polled Velocity Solution in ECEF
143  NAV_VELNED = 0x12, // Periodic/Polled Velocity Solution in NED
144  };
145 
146  typedef enum // State machine states
147  {
158  } parse_state_t;
159 
160  typedef struct
161  {
162  uint8_t clsID;
163  uint8_t msgID;
164  } __attribute__((packed)) ACK_ACK_t;
165 
166  typedef struct
167  {
168  uint8_t clsID;
169  uint8_t msgID;
170  } __attribute__((packed)) ACK_NACK_t;
171 
172  typedef struct
173  {
174  uint8_t msgClass;
175  uint8_t msgID;
176  uint8_t rate;
177  } __attribute__((packed)) CFG_MSG_t;
178 
179  typedef struct // Navigation settings, for CFG NAV5 command
180  {
181  enum //DYNMODE options
182  {
183  DYNMODE_PORTABLE = 0,
184  DYNMODE_STATIONARY = 2,
185  DYNMODE_PEDESTRIAN = 3,
186  DYNMODE_AUTOMOTIVE = 4,
187  DYNMODE_SEA = 5,
188  DYNMODE_AIRBORNE_1G = 6,
189  DYNMODE_AIRBORNE_2G = 7,
190  DYNMODE_AIRBORNE_4G = 8
191  };
192  enum //FIXMODE options
193  {
194  FIXMODE_2D_ONLY = 1,
195  FIXMODE_3D_ONLY = 2,
196  FIXMODE_AUTO = 3,
197  };
198 
199  enum //UTC options
200  {
201  UTC_STANDARD_AUTO = 0, // receiver selects based on GNSS configuration (see GNSS time bases).
202  UTC_STANDARD_USA = 3, // UTC as operated by the U.S. Naval Observatory (USNO); derived from GPS time
203  UTC_STANDARD_RUS = 6, // UTC as operated by the former Soviet Union; derived from GLONASS time
204  UTC_STANDARD_CHN = 7, // UTC as operated by the National Time Service Center, China; derived from BeiDou time
205  };
206 
207  enum //MASK options
208  {
209  MASK_DYN = 0x001, // Apply dynamic model settings
210  MASK_MINEL = 0x002, // Apply minimum elevation settings
211  MASK_POSFIXMODE = 0x004, // Apply fix mode settings
212  MASK_DRLIM = 0x008, // Reserved
213  MASK_POSMASK = 0x010, // Apply position mask settings
214  MASK_TIMEMASK = 0x020, // Apply time mask settings
215  MASK_STATICHOLDMASK = 0x040, // Apply static hold settings
216  MASK_DGPSMASK = 0x080, // Apply DGPS settings.
217  MASK_CNOTHRESHOLD = 0x100, // Apply CNO threshold settings (cnoThresh, cnoThreshNumSVs).
218  MASK_UTC = 0x200, // Apply UTC settings
219  };
220 
221  uint16_t mask;
222  uint8_t dynModel;
223  uint8_t fixMode;
224  int32_t fixedAlt; // (1e-2 m) Fixed altitude (mean sea level) for 2D fix mode.
225  uint32_t fixedAltVar; // (0.0001 m^2)Fixed altitude variance for 2D mode.
226  int8_t minElev; // (deg) Minimum Elevation for a GNSS satellite to be used in NAV
227  uint8_t drLimit; // s Reserved
228  uint16_t pDop; // (0.1) - Position DOP Mask to use
229  uint16_t tDop; // (0.1) - Time DOP Mask to use
230  uint16_t pAcc; // m Position Accuracy Mask
231  uint16_t tAcc; // m Time Accuracy Mask
232  uint8_t staticHoldThr; // esh cm/s Static hold threshold
233  uint8_t dgnssTimeout; // s DGNSS timeout
234  uint8_t cnoThreshNumS; // Vs - Number of satellites required to have C/N0 above cnoThresh for a fix to be attempted
235  uint8_t cnoThresh; // dBHz C/N0 threshold for deciding whether to attempt a fix
236  uint8_t reserved1[2]; // - Reserved
237  uint16_t staticHoldMax; // Dist m Static hold distance threshold (before quitting static hold)
238  uint8_t utcStandard; // - UTC standard to be used:
239  uint8_t reserved2[5];
240 
241  } __attribute__((packed)) CFG_NAV5_t;
242 
243  typedef struct // Port settings, for CFG PRT command
244  {
245  enum // Serial Port choice
246  {
247  PORT_I2C = 0,
248  PORT_UART1 = 1,
249  PORT_USB = 3,
250  PORT_SPI = 4
251  };
252  enum // UART settings
253  {
254  CHARLEN_8BIT = 0x00C0,
255  PARITY_NONE = 0x0800,
256  STOP_BITS_1 = 0x0000
257  };
258  enum // In Protocol choice
259  {
260  IN_UBX = 0x01,
261  IN_NMEA = 0x02,
262  IN_RTCM = 0x04,
263  IN_RTCM3 = 0x20,
264  };
265  enum // Out Protocal choice
266  {
267  OUT_UBX = 0x01,
268  OUT_NMEA = 0x02,
269  OUT_RTCM3 = 0x20,
270  };
271  uint8_t portID;
272  uint8_t reserved1;
273  uint16_t txReady;
274  uint32_t mode; // What the mode the serial data is on (See charlen, parity and stop bits)
275  uint32_t baudrate;
276  uint16_t inProtoMask; // Which input protocols are enabled
277  uint16_t outProtoMask; // Which output protocols are enabled
278  uint16_t flags;
279  uint8_t reserved2[2];
280  } __attribute__((packed)) CFG_PRT_t;
281 
282  typedef struct // Ouput rate settings, for CFG RATE command
283  {
284  enum // Time Reference choice
285  {
286  TIME_REF_UTC = 0,
287  TIME_REF_GPS = 1,
288  TIME_REF_GLONASS = 2,
289  TIME_REF_BUIDOU = 3,
290  TIME_REF_GALILEO = 4
291  };
292  uint16_t measRate; // (ms) The elapsed time between GNSS measurements which defines the rate
293  uint16_t navRate; // (cycles) The ratio between the number of measurements and the number of navigation solutions, e.g. 5 means five measurements for every navigation solution
294  uint16_t timeRef; // Time system to which measurements are aligned
295  } __attribute__((packed)) CFG_RATE_t;
296 
297  //Time data is pulled into a separate struct for ease of use
298  typedef struct
299  {
300  uint16_t year; // y Year (UTC)
301  uint8_t month; // month Month, range 1..12 (UTC)
302  uint8_t day; // d Day of month, range 1..31 (UTC)
303  uint8_t hour; // h Hour of day, range 0..23 (UTC)
304  uint8_t min; // min Minute of hour, range 0..59 (UTC)
305  uint8_t sec; // s Seconds of minute, range 0..60 (UTC)
306  uint8_t valid; // - Validity flags (see graphic below )
307  uint32_t tAcc; // ns Time accuracy estimate (UTC)
308  int32_t nano; // ns Fraction of second, range -1e9 .. 1e9 (UTC)
309  } __attribute__((packed)) GNSS_TIME_T;
310  typedef struct // Position, velocity, time packet NAV PVT
311  {
312  enum //Time validity flags
313  {
314  VALIDITY_FLAGS_VALIDDATE= 0x01, // Valid UTC Date (see Time Validity section for details)
315  VALIDITY_FLAGS_VALIDTIME = 0x02, // Valid UTC Time of Day (see Time Validity section for details)
316  VALIDITY_FLAGS_FULLYRESOLVED = 0x04, // UTC Time of Day has been fully resolved (no seconds uncertainty)
317  };
318 
319  enum // Flags from the "flags" field
320  {
321  FIX_STATUS_GNSS_FIX_OK = 0x01, // Valid Fix
322  FIX_STATUS_DIFF_SOLN = 0x02, // Differential Corrections were applied
323  FIX_STATUS_PSM_STATE_NOT_ACTIVE = 0x00,
324  FIX_STATUS_PSM_STATE_ENABLED = 0x04,
325  FIX_STATUS_PSM_STATE_ACQUISITION = 0x08,
326  FIX_STATUS_PSM_STATE_TRACKING = 0x0C,
327  FIX_STATUS_PSM_STATE_POWER_OPTIMIZED_TRACKING = 0x10,
328  FIX_STATUS_PSM_STATE_INACTIVE = 0x14,
329  FIX_STATUS_HEADING_VALID = 0x20,
330  FIX_STATUS_CARR_SOLN_NONE = 0x00,
331  FIX_STATUS_CARR_SOLN_FLOAT = 0x40,
332  FIX_STATUS_CARR_SOLN_FIXED = 0x80,
333  };
334 
335  uint32_t iTOW; // ms GPS time of week of the navigation epoch . See the description of iTOW for details.
336  GNSS_TIME_T time; //Pulled out into a struct for easier use
337  uint8_t fixType; // - GNSSfix Type:
338  uint8_t flags; // - Fix status flags (see graphic below )
339  uint8_t flags2; // - Additional flags (see graphic below )
340  uint8_t numSV; // - Number of satellites used in Nav Solution
341  int32_t lon; // 1e-7 deg Longitude
342  int32_t lat; // 1e-7 deg Latitude
343  int32_t height; // mm Height above ellipsoid
344  int32_t hMSL; // mm Height above mean sea level
345  uint32_t hAcc; // mm Horizontal accuracy estimate
346  uint32_t vAcc; // mm Vertical accuracy estimate
347  int32_t velN; // mm/s NED north velocity
348  int32_t velE; // mm/s NED east velocity
349  int32_t velD; // mm/s NED down velocity
350  int32_t gSpeed; // mm/s Ground Speed (2-D)
351  int32_t headMot; // 1e-5 deg Heading of motion (2-D)
352  uint32_t sAcc; // mm/s Speed accuracy estimate
353  uint32_t headAcc; // 1e-5 deg Heading accuracy estimate (both motion and vehicle)
354  uint16_t pDOP; // 0.01 - Position DOP
355  uint8_t reserved1; //[6] - Reserved
356  int32_t headVeh; // 1e-5 deg Heading of vehicle (2-D)
357  int16_t magDec; // 1e-2 deg Magnetic declination
358  uint16_t magAcc; // 1e-2 deg Magnetic declination accuracy
359  } __attribute__((packed)) NAV_PVT_t;
360 
361  //This struct is manually generatated, and meant to allow easier conversions
362  typedef struct
363  {
364  uint16_t year; // y Year (UTC)
365  uint8_t month; // month Month, range 1..12 (UTC)
366  uint8_t day; // d Day of month, range 1..31 (UTC)
367  uint8_t hour; // h Hour of day, range 0..23 (UTC)
368  uint8_t min; // min Minute of hour, range 0..59 (UTC)
369  uint8_t sec; // s Seconds of minute, range 0..60 (UTC)
370  int32_t nano; // ns Fraction of second, range -1e9 .. 1e9 (UTC)
371  } UTCTime;
372 
373  typedef struct // Earth centered, earth fixed position data
374  {
375  uint32_t iTOW; // ms GPS time of week of the navigation epoch . See the description of iTOW for details.
376  int32_t ecefX; // cm ECEF X coordinate
377  int32_t ecefY; // cm ECEF Y coordinate
378  int32_t ecefZ; // cm ECEF Z coordinate
379  uint32_t pAcc; // cm Position Accuracy Estimate
380  } __attribute__((packed)) NAV_POSECEF_t;
381 
382  typedef struct //Earth centered, earth fixed velocity data
383  {
384  uint32_t iTOW; // ms GPS time of week of the navigation epoch . See the description of iTOW for details.
385  int32_t ecefVX; // cm ECEF X velocity
386  int32_t ecefVY; // cm ECEF Y velocity
387  int32_t ecefVZ; // cm ECEF Z velocity
388  uint32_t sAcc; // cm Speed Accuracy Estimate
389  } __attribute__((packed)) NAV_VELECEF_t;
390 
391  typedef union //A union of all of the message data payloads, to allow for reinterpretation
392  {
394  ACK_ACK_t ACK_ACK;
395  ACK_NACK_t ACK_NACK;
396  CFG_MSG_t CFG_MSG;
397  CFG_PRT_t CFG_PRT;
398  CFG_RATE_t CFG_RATE;
399  CFG_NAV5_t CFG_NAV5;
400  NAV_PVT_t NAV_PVT;
401  NAV_POSECEF_t NAV_POSECEF;
402  NAV_VELECEF_t NAV_VELECEF;
403  } UBX_message_t;
404 
405  struct GNSSPVT
406  {
407  uint32_t time_of_week;
408  uint64_t time;
409  uint64_t nanos;
410  int32_t lat;
411  int32_t lon;
412  int32_t height;
413  int32_t vel_n;
414  int32_t vel_e;
415  int32_t vel_d;
416  uint32_t h_acc;
417  uint32_t v_acc;
419  };
420 
421 //The following structs are used as return values
422  struct GNSSPosECEF
423  {
424  uint32_t time_of_week;//time of week. Only to be used as a stamp
425  int32_t x;//cm
426  int32_t y;//cm
427  int32_t z;//cm
428  uint32_t p_acc;//cm
429  };
430 
431  struct GNSSVelECEF
432  {
433  uint32_t time_of_week;//time of week. Only to be used as a stamp
434  int32_t vx;//cm/s
435  int32_t vy;//cm/s
436  int32_t vz;//cm/s
437  uint32_t s_acc;//cm/s
438  };
439 
440  void init(UART *uart);
441 
442  bool present();
443  bool new_data(); //Returns true if new data has been recieved, AND the time of week stamps on all of the data matches
444  GNSSPVT read();
447  const NAV_PVT_t &read_raw();
448  void read_ecef(int32_t *pos_ecef, int32_t *vel_ecef, uint32_t &p_acc_ecef, uint32_t &s_acc_ecef);
449  void read_cb(uint8_t byte);
451  {
452  return num_messages_received_;
453  }
454 
455  void ned(float *vel) const;
456  void posECEF(double *pos) const;
457  void velECEF(double *vel) const;
458 
459  inline uint64_t get_last_pvt_timestamp()
460  {
461  return last_pvt_timestamp;
462  }
463 
464 
465 private:
466  bool detect_baudrate();
467  void convert_data();
468  void enable_message(uint8_t msg_cls, uint8_t msg_id, uint8_t rate);
469  void set_baudrate(const uint32_t baudrate);
470  void set_dynamic_mode();
471  void set_nav_rate(uint8_t period_ms);
472  bool decode_message();
473  void calculate_checksum(const uint8_t msg_cls, const uint8_t msg_id, const uint16_t len, const UBX_message_t payload,
474  uint8_t &ck_a, uint8_t &ck_b) const;
475  bool send_message(uint8_t msg_class, uint8_t msg_id, UBX_message_t &message, uint16_t len);
476 
477  uint32_t current_baudrate_ = 115200;
478  const uint32_t baudrates[5] = {115200, 19200, 57600, 9600, 38400};
479 
482 
483  uint16_t buffer_head_ = 0;
484  bool got_message_ = false;
485  bool got_ack_ = false;
486  bool got_nack_ = false;
487  parse_state_t parse_state_;
488  uint8_t message_class_;
489  uint8_t message_type_;
490  uint16_t length_;
491  uint8_t ck_a_;
492  uint8_t ck_b_;
493  uint32_t num_errors_ = 0;
494  volatile uint32_t num_messages_received_ = 0;
495 
496  double lla_[3] = {};
497  float vel_[3] = {};
498 
499  uint64_t last_pvt_timestamp=0;
500  uint64_t time_ = 0;
501 
502  bool looking_for_nmea_ = true;
503  uint8_t prev_byte_ = 0;
504 
505  UART *serial_ = nullptr;
506 
507  volatile bool new_data_ = false;
508 #pragma GCC diagnostic push
509 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
510  NAV_PVT_t nav_message_ = {};
511  NAV_POSECEF_t pos_ecef_ = {};
512  NAV_VELECEF_t vel_ecef_ = {};
513 #pragma GCC diagnostic pop
514 };
515 
516 const std::string fix_names[6] =
517 {
518  "FIX_TYPE_NO_FIX",
519  "FIX_TYPE_DEAD_RECKONING",
520  "FIX_TYPE_2D",
521  "FIX_TYPE_3D",
522  "FIX_TYPE_GPS_AND_DEAD_RECKONING",
523  "FIX_TYPE_TIME_ONLY",
524 };
525 
526 
527 
528 #endif // UBLOX_H
uint32_t time_of_week
Definition: ublox.h:433
uint64_t time_
Definition: ublox.h:500
CFG_NAV5_t CFG_NAV5
Definition: ublox.h:399
void read_ecef(int32_t *pos_ecef, int32_t *vel_ecef, uint32_t &p_acc_ecef, uint32_t &s_acc_ecef)
#define UBLOX_BUFFER_SIZE
Definition: ublox.h:4
uint16_t flags
Definition: ublox.h:278
int16_t magDec
Definition: ublox.h:357
bool got_ack_
Definition: ublox.h:485
int32_t vel_e
Definition: ublox.h:414
void set_dynamic_mode()
Definition: ublox.cpp:139
void calculate_checksum(const uint8_t msg_cls, const uint8_t msg_id, const uint16_t len, const UBX_message_t payload, uint8_t &ck_a, uint8_t &ck_b) const
Definition: ublox.cpp:476
uint64_t get_last_pvt_timestamp()
Definition: ublox.h:459
uint8_t utcStandard
Definition: ublox.h:238
void set_baudrate(const uint32_t baudrate)
Definition: ublox.cpp:114
volatile uint32_t num_messages_received_
Definition: ublox.h:494
NAV_POSECEF_t NAV_POSECEF
Definition: ublox.h:401
uint8_t ck_a_
Definition: ublox.h:491
uint16_t pDop
Definition: ublox.h:228
bool got_message_
Definition: ublox.h:484
uint8_t ck_b_
Definition: ublox.h:492
uint32_t time_of_week
Definition: ublox.h:407
void posECEF(double *pos) const
uint16_t tAcc
Definition: ublox.h:231
uint32_t mode
Definition: ublox.h:274
int32_t ecefVX
Definition: ublox.h:385
uint32_t num_errors_
Definition: ublox.h:493
void velECEF(double *vel) const
uint8_t msgClass
Definition: ublox.h:174
Definition: ublox.h:15
uint8_t min
Definition: ublox.h:368
uint8_t prev_byte_
Definition: ublox.h:503
UBLOX()
Definition: ublox.cpp:20
void enable_message(uint8_t msg_cls, uint8_t msg_id, uint8_t rate)
Definition: ublox.cpp:159
int32_t vy
Definition: ublox.h:435
bool looking_for_nmea_
Definition: ublox.h:502
uint64_t rosflight_timestamp
Definition: ublox.h:418
uint16_t length_
Definition: ublox.h:490
uint16_t staticHoldMax
Definition: ublox.h:237
int32_t gSpeed
Definition: ublox.h:350
float vel_[3]
Definition: ublox.h:497
static uint8_t buffer[BMP280_DATA_FRAME_SIZE]
Definition: drv_bmp280.c:61
uint16_t navRate
Definition: ublox.h:293
int32_t nano
Definition: ublox.h:370
NAV_VELECEF_t vel_ecef_
Definition: ublox.h:512
UBX_message_t out_message_
Definition: ublox.h:480
uint8_t dgnssTimeout
Definition: ublox.h:233
uint32_t s_acc
Definition: ublox.h:437
NAV_PVT_t NAV_PVT
Definition: ublox.h:400
uint8_t hour
Definition: ublox.h:367
volatile bool new_data_
Definition: ublox.h:507
bool decode_message()
Definition: ublox.cpp:390
void init(UART *uart)
Definition: ublox.cpp:23
uint16_t buffer_head_
Definition: ublox.h:483
parse_state_t parse_state_
Definition: ublox.h:487
uint32_t pAcc
Definition: ublox.h:379
uint8_t drLimit
Definition: ublox.h:227
uint32_t iTOW
Definition: ublox.h:335
CFG_RATE_t CFG_RATE
Definition: ublox.h:398
uint32_t num_messages_received()
Definition: ublox.h:450
uint32_t fixedAltVar
Definition: ublox.h:225
int32_t ecefVY
Definition: ublox.h:386
uint8_t dynModel
Definition: ublox.h:222
uint8_t message_type_
Definition: ublox.h:489
uint32_t headAcc
Definition: ublox.h:353
uint64_t time
Definition: ublox.h:408
const std::string fix_names[6]
Definition: ublox.h:516
uint32_t hAcc
Definition: ublox.h:345
uint16_t mask
Definition: ublox.h:221
uint16_t year
Definition: ublox.h:300
uint8_t sec
Definition: ublox.h:369
uint8_t message_class_
Definition: ublox.h:488
uint32_t current_baudrate_
Definition: ublox.h:477
uint32_t sAcc
Definition: ublox.h:352
void ned(float *vel) const
int32_t height
Definition: ublox.h:412
uint32_t p_acc
Definition: ublox.h:428
int32_t lat
Definition: ublox.h:410
uint8_t portID
Definition: ublox.h:271
int32_t vx
Definition: ublox.h:434
uint16_t measRate
Definition: ublox.h:292
const NAV_PVT_t & read_raw()
Definition: ublox.cpp:384
bool send_message(uint8_t msg_class, uint8_t msg_id, UBX_message_t &message, uint16_t len)
Definition: ublox.cpp:91
Definition: uart.h:43
void set_nav_rate(uint8_t period_ms)
Definition: ublox.cpp:149
uint8_t fixType
Definition: ublox.h:337
uint16_t magAcc
Definition: ublox.h:358
int32_t lon
Definition: ublox.h:411
GNSS_TIME_T time
Definition: ublox.h:336
int32_t headVeh
Definition: ublox.h:356
double lla_[3]
Definition: ublox.h:496
uint16_t pDOP
Definition: ublox.h:354
uint8_t staticHoldThr
Definition: ublox.h:232
uint16_t outProtoMask
Definition: ublox.h:277
uint32_t time_of_week
Definition: ublox.h:424
uint16_t tDop
Definition: ublox.h:229
uint32_t v_acc
Definition: ublox.h:417
bool got_nack_
Definition: ublox.h:486
bool new_data()
Definition: ublox.cpp:333
int32_t vel_d
Definition: ublox.h:415
bool present()
Definition: ublox.cpp:133
ACK_NACK_t ACK_NACK
Definition: ublox.h:395
NAV_VELECEF_t NAV_VELECEF
Definition: ublox.h:402
GNSSPosECEF read_pos_ecef()
Definition: ublox.cpp:362
uint8_t month
Definition: ublox.h:365
uint16_t inProtoMask
Definition: ublox.h:276
uint16_t pAcc
Definition: ublox.h:230
const uint32_t baudrates[5]
Definition: ublox.h:478
uint16_t year
Definition: ublox.h:364
uint8_t flags2
Definition: ublox.h:339
int32_t vel_n
Definition: ublox.h:413
uint8_t day
Definition: ublox.h:366
bool detect_baudrate()
Definition: ublox.cpp:63
struct __attribute__((packed))
Definition: usbd_cdc_vcp.h:66
uint8_t cnoThreshNumS
Definition: ublox.h:234
int32_t fixedAlt
Definition: ublox.h:224
uint64_t last_pvt_timestamp
Definition: ublox.h:499
uint32_t h_acc
Definition: ublox.h:416
void read_cb(uint8_t byte)
Definition: ublox.cpp:170
int32_t ecefVZ
Definition: ublox.h:387
uint32_t tAcc
Definition: ublox.h:307
CFG_MSG_t CFG_MSG
Definition: ublox.h:396
uint8_t cnoThresh
Definition: ublox.h:235
int32_t height
Definition: ublox.h:343
uint16_t txReady
Definition: ublox.h:273
GNSSVelECEF read_vel_ecef()
Definition: ublox.cpp:373
parse_state_t
Definition: ublox.h:146
CFG_PRT_t CFG_PRT
Definition: ublox.h:397
NAV_POSECEF_t pos_ecef_
Definition: ublox.h:511
int32_t headMot
Definition: ublox.h:351
uint32_t baudrate
Definition: ublox.h:275
int32_t vz
Definition: ublox.h:436
ACK_ACK_t ACK_ACK
Definition: ublox.h:394
UBX_message_t in_message_
Definition: ublox.h:481
NAV_PVT_t nav_message_
Definition: ublox.h:510
uint8_t fixMode
Definition: ublox.h:223
void convert_data()
Definition: ublox.cpp:464
uint64_t nanos
Definition: ublox.h:409
UART * serial_
Definition: ublox.h:505
uint16_t timeRef
Definition: ublox.h:294
uint32_t vAcc
Definition: ublox.h:346
GNSSPVT read()
Definition: ublox.cpp:341


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:26