Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
UBLOX Class Reference

#include <ublox.h>

Classes

struct  __attribute__
 
union  UBX_message_t
 

Public Types

enum  {
  CLASS_NAV = 0x01, CLASS_RXM = 0x02, CLASS_INF = 0x04, CLASS_ACK = 0x05,
  CLASS_CFG = 0x06, CLASS_UPD = 0x09, CLASS_MON = 0x0A, CLASS_AID = 0x0B,
  CLASS_TIM = 0x0D, CLASS_ESF = 0x10, CLASS_MGA = 0x13, CLASS_LOG = 0x21
}
 
enum  { ACK_ACK = 0x01, ACK_NACK = 0x00 }
 
enum  {
  AID_ALM = 0x30, AID_AOP = 0x33, AID_EPH = 0x31, AID_HUI = 0x02,
  AID_INI = 0x01
}
 
enum  {
  CFG_ANT = 0x13, CFG_BATCH = 0x93, CFG_CFG = 0x09, CFG_DAT = 0x06,
  CFG_DGNSS = 0x70, CFG_DOSC = 0x61, CFG_DYNSEED = 0x85, CFG_ESRC = 0x60,
  CFG_FIXSEED = 0x84, CFG_GEOFENCE = 0x69, CFG_GNSS = 0x3E, CFG_HNR = 0x5C,
  CFG_INF = 0x02, CFG_ITFM = 0x39, FG_LOGFILTER = 0x47, CFG_MSG = 0x01,
  CFG_NAV5 = 0x24, CFG_NAVX5 = 0x23, CFG_NMEA = 0x17, CFG_ODO = 0x1E,
  CFG_PM2 = 0x3B, CFG_PMS = 0x86, CFG_PRT = 0x00, CFG_PWR = 0x57,
  CFG_RATE = 0x08, CFG_RINV = 0x34, CFG_RST = 0x04, CFG_RXM = 0x11,
  CFG_SBAS = 0x16, CFG_SMGR = 0x62, CFG_TMODE2 = 0x3D, CFG_TMODE3 = 0x71,
  CFG_TP5 = 0x31, CFG_TXSLOT = 0x53, CFG_USB = 0x1B
}
 
enum  {
  NAV_AOPSTATUS = 0x60, NAV_ATT = 0x05, NAV_CLOCK = 0x22, NAV_DGPS = 0x31,
  NAV_DOP = 0x04, NAV_EOE = 0x61, NAV_GEOFENCE = 0x39, NAV_HPPOSECEF = 0x13,
  NAV_HPPOSLLH = 0x14, NAV_ODO = 0x09, NAV_ORB = 0x34, NAV_POSECEF = 0x01,
  NAV_POSLLH = 0x02, NAV_PVT = 0x07, NAV_RELPOSNED = 0x3C, NAV_RESETODO = 0x10,
  NAV_SAT = 0x35, NAV_SBAS = 0x32, NAV_SOL = 0x06, NAV_STATUS = 0x03,
  NAV_SVINFO = 0x30, NAV_SVIN = 0x3B, NAV_TIMEBDS = 0x24, NAV_TIMEGAL = 0x25,
  NAV_TIMEGLO = 0x23, NAV_TIMEGPS = 0x20, NAV_TIMELS = 0x26, NAV_TIMEUTC = 0x21,
  NAV_VELECEF = 0x11, NAV_VELNED = 0x12
}
 
enum  {
  FIX_TYPE_NO_FIX = 0x00, FIX_TYPE_DEAD_RECKONING = 0x01, FIX_TYPE_2D = 0x02, FIX_TYPE_3D = 0x03,
  FIX_TYPE_GPS_AND_DEAD_RECKONING = 0x04, FIX_TYPE_TIME_ONLY = 0x05
}
 
enum  { START_BYTE_1 = 0xB5, START_BYTE_2 = 0x62 }
 
enum  { NMEA_START_BYTE1 = '$', NMEA_START_BYTE2 = 'G' }
 
enum  parse_state_t {
  START, GOT_START_FRAME, GOT_CLASS, GOT_MSG_ID,
  GOT_LENGTH1, GOT_LENGTH2, GOT_PAYLOAD, GOT_CK_A,
  GOT_CK_B, DONE
}
 

Public Member Functions

const NAV_PVT_t & get_nav_data () const
 
void get_pos_ecef (double *pos_ecef, uint32_t *t_ms)
 
void get_vel_ecef (float *vel_ecef, uint32_t *t_ms)
 
void init (UART *uart_drv)
 
bool new_data ()
 
uint32_t num_messages_received ()
 
void read (double *lla, float *vel, uint8_t *fix_type, uint32_t *t_ms)
 
void read_cb (uint8_t byte)
 

Private Member Functions

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
 
void convert_data ()
 
bool decode_message ()
 
void enable_message (uint8_t msg_cls, uint8_t msg_id, uint8_t rate)
 
bool send_message (uint8_t msg_class, uint8_t msg_id, UBX_message_t &message, uint16_t len)
 
void set_baudrate (const uint32_t baudrate)
 
void set_dynamic_mode ()
 
void set_nav_rate (uint8_t period_ms)
 

Private Attributes

const uint32_t baudrates [5] = {115200, 57600, 9600, 19200, 38400}
 
uint16_t buffer_head_ = 0
 
uint8_t ck_a_
 
uint8_t ck_b_
 
uint32_t current_baudrate_ = 115200
 
char debug_buffer_ [15]
 
uint16_t debug_buffer_head_ = 0
 
bool got_ack_ = false
 
bool got_message_ = false
 
bool got_nack_ = false
 
UBX_message_t in_message_
 
uint16_t length_
 
double lla_ [3]
 
bool looking_for_nmea_
 
uint8_t message_class_
 
uint8_t message_type_
 
NAV_PVT_t nav_message_
 
bool new_data_
 
uint32_t num_errors_ = 0
 
uint32_t num_messages_received_ = 0
 
UBX_message_t out_message_
 
parse_state_t parse_state_
 
NAV_POSECEF_t pos_ecef_message_
 
uint8_t prev_byte_ = 0
 
UARTserial_
 
int32_t system_start_tow_ms_
 
float vel_ [3]
 
NAV_VELECEF_t vel_ecef_message_
 

Detailed Description

Definition at line 9 of file ublox.h.

Member Enumeration Documentation

anonymous enum
Enumerator
CLASS_NAV 
CLASS_RXM 
CLASS_INF 
CLASS_ACK 
CLASS_CFG 
CLASS_UPD 
CLASS_MON 
CLASS_AID 
CLASS_TIM 
CLASS_ESF 
CLASS_MGA 
CLASS_LOG 

Definition at line 30 of file ublox.h.

anonymous enum
Enumerator
ACK_ACK 
ACK_NACK 

Definition at line 45 of file ublox.h.

anonymous enum
Enumerator
AID_ALM 
AID_AOP 
AID_EPH 
AID_HUI 
AID_INI 

Definition at line 50 of file ublox.h.

anonymous enum
Enumerator
CFG_ANT 
CFG_BATCH 
CFG_CFG 
CFG_DAT 
CFG_DGNSS 
CFG_DOSC 
CFG_DYNSEED 
CFG_ESRC 
CFG_FIXSEED 
CFG_GEOFENCE 
CFG_GNSS 
CFG_HNR 
CFG_INF 
CFG_ITFM 
FG_LOGFILTER 
CFG_MSG 
CFG_NAV5 
CFG_NAVX5 
CFG_NMEA 
CFG_ODO 
CFG_PM2 
CFG_PMS 
CFG_PRT 
CFG_PWR 
CFG_RATE 
CFG_RINV 
CFG_RST 
CFG_RXM 
CFG_SBAS 
CFG_SMGR 
CFG_TMODE2 
CFG_TMODE3 
CFG_TP5 
CFG_TXSLOT 
CFG_USB 

Definition at line 58 of file ublox.h.

anonymous enum
Enumerator
NAV_AOPSTATUS 
NAV_ATT 
NAV_CLOCK 
NAV_DGPS 
NAV_DOP 
NAV_EOE 
NAV_GEOFENCE 
NAV_HPPOSECEF 
NAV_HPPOSLLH 
NAV_ODO 
NAV_ORB 
NAV_POSECEF 
NAV_POSLLH 
NAV_PVT 
NAV_RELPOSNED 
NAV_RESETODO 
NAV_SAT 
NAV_SBAS 
NAV_SOL 
NAV_STATUS 
NAV_SVINFO 
NAV_SVIN 
NAV_TIMEBDS 
NAV_TIMEGAL 
NAV_TIMEGLO 
NAV_TIMEGPS 
NAV_TIMELS 
NAV_TIMEUTC 
NAV_VELECEF 
NAV_VELNED 

Definition at line 96 of file ublox.h.

anonymous enum
Enumerator
FIX_TYPE_NO_FIX 
FIX_TYPE_DEAD_RECKONING 
FIX_TYPE_2D 
FIX_TYPE_3D 
FIX_TYPE_GPS_AND_DEAD_RECKONING 
FIX_TYPE_TIME_ONLY 

Definition at line 11 of file ublox.h.

anonymous enum
Enumerator
START_BYTE_1 
START_BYTE_2 

Definition at line 20 of file ublox.h.

anonymous enum
Enumerator
NMEA_START_BYTE1 
NMEA_START_BYTE2 

Definition at line 25 of file ublox.h.

Enumerator
START 
GOT_START_FRAME 
GOT_CLASS 
GOT_MSG_ID 
GOT_LENGTH1 
GOT_LENGTH2 
GOT_PAYLOAD 
GOT_CK_A 
GOT_CK_B 
DONE 

Definition at line 129 of file ublox.h.

Member Function Documentation

void UBLOX::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
private

Definition at line 333 of file ublox.cpp.

void UBLOX::convert_data ( )
private

Definition at line 321 of file ublox.cpp.

bool UBLOX::decode_message ( )
private

Definition at line 254 of file ublox.cpp.

void UBLOX::enable_message ( uint8_t  msg_cls,
uint8_t  msg_id,
uint8_t  rate 
)
private

Definition at line 115 of file ublox.cpp.

const NAV_PVT_t& UBLOX::get_nav_data ( ) const
inline

Definition at line 356 of file ublox.h.

void UBLOX::get_pos_ecef ( double *  pos_ecef,
uint32_t *  t_ms 
)

Definition at line 222 of file ublox.cpp.

void UBLOX::get_vel_ecef ( float *  vel_ecef,
uint32_t *  t_ms 
)

Definition at line 230 of file ublox.cpp.

void UBLOX::init ( UART uart_drv)

Definition at line 12 of file ublox.cpp.

bool UBLOX::new_data ( )
inline

Definition at line 354 of file ublox.h.

uint32_t UBLOX::num_messages_received ( )
inline

Definition at line 355 of file ublox.h.

void UBLOX::read ( double *  lla,
float *  vel,
uint8_t *  fix_type,
uint32_t *  t_ms 
)

Definition at line 238 of file ublox.cpp.

void UBLOX::read_cb ( uint8_t  byte)

Definition at line 125 of file ublox.cpp.

bool UBLOX::send_message ( uint8_t  msg_class,
uint8_t  msg_id,
UBX_message_t message,
uint16_t  len 
)
private

Definition at line 62 of file ublox.cpp.

void UBLOX::set_baudrate ( const uint32_t  baudrate)
private

Definition at line 83 of file ublox.cpp.

void UBLOX::set_dynamic_mode ( )
private

Definition at line 98 of file ublox.cpp.

void UBLOX::set_nav_rate ( uint8_t  period_ms)
private

Definition at line 106 of file ublox.cpp.

Member Data Documentation

const uint32_t UBLOX::baudrates[5] = {115200, 57600, 9600, 19200, 38400}
private

Definition at line 372 of file ublox.h.

uint16_t UBLOX::buffer_head_ = 0
private

Definition at line 380 of file ublox.h.

uint8_t UBLOX::ck_a_
private

Definition at line 388 of file ublox.h.

uint8_t UBLOX::ck_b_
private

Definition at line 389 of file ublox.h.

uint32_t UBLOX::current_baudrate_ = 115200
private

Definition at line 371 of file ublox.h.

char UBLOX::debug_buffer_[15]
private

Definition at line 377 of file ublox.h.

uint16_t UBLOX::debug_buffer_head_ = 0
private

Definition at line 378 of file ublox.h.

bool UBLOX::got_ack_ = false
private

Definition at line 382 of file ublox.h.

bool UBLOX::got_message_ = false
private

Definition at line 381 of file ublox.h.

bool UBLOX::got_nack_ = false
private

Definition at line 383 of file ublox.h.

UBX_message_t UBLOX::in_message_
private

Definition at line 375 of file ublox.h.

uint16_t UBLOX::length_
private

Definition at line 387 of file ublox.h.

double UBLOX::lla_[3]
private

Definition at line 393 of file ublox.h.

bool UBLOX::looking_for_nmea_
private

Definition at line 396 of file ublox.h.

uint8_t UBLOX::message_class_
private

Definition at line 385 of file ublox.h.

uint8_t UBLOX::message_type_
private

Definition at line 386 of file ublox.h.

NAV_PVT_t UBLOX::nav_message_
private

Definition at line 403 of file ublox.h.

bool UBLOX::new_data_
private

Definition at line 401 of file ublox.h.

uint32_t UBLOX::num_errors_ = 0
private

Definition at line 390 of file ublox.h.

uint32_t UBLOX::num_messages_received_ = 0
private

Definition at line 391 of file ublox.h.

UBX_message_t UBLOX::out_message_
private

Definition at line 374 of file ublox.h.

parse_state_t UBLOX::parse_state_
private

Definition at line 384 of file ublox.h.

NAV_POSECEF_t UBLOX::pos_ecef_message_
private

Definition at line 404 of file ublox.h.

uint8_t UBLOX::prev_byte_ = 0
private

Definition at line 397 of file ublox.h.

UART* UBLOX::serial_
private

Definition at line 399 of file ublox.h.

int32_t UBLOX::system_start_tow_ms_
private

Definition at line 402 of file ublox.h.

float UBLOX::vel_[3]
private

Definition at line 394 of file ublox.h.

NAV_VELECEF_t UBLOX::vel_ecef_message_
private

Definition at line 405 of file ublox.h.


The documentation for this class was generated from the following files:


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Mon Jan 13 2020 19:50:06