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

#include <ublox.h>

Classes

struct  __attribute__
 
struct  GNSSPosECEF
 
struct  GNSSPVT
 
struct  GNSSVelECEF
 
union  UBX_message_t
 
struct  UTCTime
 

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, CFG_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

uint64_t get_last_pvt_timestamp ()
 
void init (UART *uart)
 
void ned (float *vel) const
 
bool new_data ()
 
uint32_t num_messages_received ()
 
void posECEF (double *pos) const
 
bool present ()
 
GNSSPVT read ()
 
void read_cb (uint8_t byte)
 
void read_ecef (int32_t *pos_ecef, int32_t *vel_ecef, uint32_t &p_acc_ecef, uint32_t &s_acc_ecef)
 
GNSSPosECEF read_pos_ecef ()
 
const NAV_PVT_t & read_raw ()
 
GNSSVelECEF read_vel_ecef ()
 
 UBLOX ()
 
void velECEF (double *vel) const
 

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 ()
 
bool detect_baudrate ()
 
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, 19200, 57600, 9600, 38400}
 
uint16_t buffer_head_ = 0
 
uint8_t ck_a_
 
uint8_t ck_b_
 
uint32_t current_baudrate_ = 115200
 
bool got_ack_ = false
 
bool got_message_ = false
 
bool got_nack_ = false
 
UBX_message_t in_message_ = {}
 
uint64_t last_pvt_timestamp =0
 
uint16_t length_
 
double lla_ [3] = {}
 
bool looking_for_nmea_ = true
 
uint8_t message_class_
 
uint8_t message_type_
 
NAV_PVT_t nav_message_ = {}
 
volatile bool new_data_ = false
 
uint32_t num_errors_ = 0
 
volatile uint32_t num_messages_received_ = 0
 
UBX_message_t out_message_ = {}
 
parse_state_t parse_state_
 
NAV_POSECEF_t pos_ecef_ = {}
 
uint8_t prev_byte_ = 0
 
UARTserial_ = nullptr
 
uint64_t time_ = 0
 
float vel_ [3] = {}
 
NAV_VELECEF_t vel_ecef_ = {}
 

Detailed Description

Definition at line 15 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 42 of file ublox.h.

anonymous enum
Enumerator
ACK_ACK 
ACK_NACK 

Definition at line 58 of file ublox.h.

anonymous enum
Enumerator
AID_ALM 
AID_AOP 
AID_EPH 
AID_HUI 
AID_INI 

Definition at line 64 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 
CFG_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 73 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 112 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 20 of file ublox.h.

anonymous enum
Enumerator
START_BYTE_1 
START_BYTE_2 

Definition at line 30 of file ublox.h.

anonymous enum
Enumerator
NMEA_START_BYTE1 
NMEA_START_BYTE2 

Definition at line 36 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 146 of file ublox.h.

Constructor & Destructor Documentation

UBLOX::UBLOX ( )

Definition at line 20 of file ublox.cpp.

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 476 of file ublox.cpp.

void UBLOX::convert_data ( )
private

Definition at line 464 of file ublox.cpp.

bool UBLOX::decode_message ( )
private

Definition at line 390 of file ublox.cpp.

bool UBLOX::detect_baudrate ( )
private

Definition at line 63 of file ublox.cpp.

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

Definition at line 159 of file ublox.cpp.

uint64_t UBLOX::get_last_pvt_timestamp ( )
inline

Definition at line 459 of file ublox.h.

void UBLOX::init ( UART uart)

Definition at line 23 of file ublox.cpp.

void UBLOX::ned ( float *  vel) const
bool UBLOX::new_data ( )

Definition at line 333 of file ublox.cpp.

uint32_t UBLOX::num_messages_received ( )
inline

Definition at line 450 of file ublox.h.

void UBLOX::posECEF ( double *  pos) const
bool UBLOX::present ( )

Definition at line 133 of file ublox.cpp.

UBLOX::GNSSPVT UBLOX::read ( )

Definition at line 341 of file ublox.cpp.

void UBLOX::read_cb ( uint8_t  byte)

Definition at line 170 of file ublox.cpp.

void UBLOX::read_ecef ( int32_t *  pos_ecef,
int32_t *  vel_ecef,
uint32_t &  p_acc_ecef,
uint32_t &  s_acc_ecef 
)
UBLOX::GNSSPosECEF UBLOX::read_pos_ecef ( )

Definition at line 362 of file ublox.cpp.

const UBLOX::NAV_PVT_t & UBLOX::read_raw ( )

Definition at line 384 of file ublox.cpp.

UBLOX::GNSSVelECEF UBLOX::read_vel_ecef ( )

Definition at line 373 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 91 of file ublox.cpp.

void UBLOX::set_baudrate ( const uint32_t  baudrate)
private

Definition at line 114 of file ublox.cpp.

void UBLOX::set_dynamic_mode ( )
private

Definition at line 139 of file ublox.cpp.

void UBLOX::set_nav_rate ( uint8_t  period_ms)
private

Definition at line 149 of file ublox.cpp.

void UBLOX::velECEF ( double *  vel) const

Member Data Documentation

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

Definition at line 478 of file ublox.h.

uint16_t UBLOX::buffer_head_ = 0
private

Definition at line 483 of file ublox.h.

uint8_t UBLOX::ck_a_
private

Definition at line 491 of file ublox.h.

uint8_t UBLOX::ck_b_
private

Definition at line 492 of file ublox.h.

uint32_t UBLOX::current_baudrate_ = 115200
private

Definition at line 477 of file ublox.h.

bool UBLOX::got_ack_ = false
private

Definition at line 485 of file ublox.h.

bool UBLOX::got_message_ = false
private

Definition at line 484 of file ublox.h.

bool UBLOX::got_nack_ = false
private

Definition at line 486 of file ublox.h.

UBX_message_t UBLOX::in_message_ = {}
private

Definition at line 481 of file ublox.h.

uint64_t UBLOX::last_pvt_timestamp =0
private

Definition at line 499 of file ublox.h.

uint16_t UBLOX::length_
private

Definition at line 490 of file ublox.h.

double UBLOX::lla_[3] = {}
private

Definition at line 496 of file ublox.h.

bool UBLOX::looking_for_nmea_ = true
private

Definition at line 502 of file ublox.h.

uint8_t UBLOX::message_class_
private

Definition at line 488 of file ublox.h.

uint8_t UBLOX::message_type_
private

Definition at line 489 of file ublox.h.

NAV_PVT_t UBLOX::nav_message_ = {}
private

Definition at line 510 of file ublox.h.

volatile bool UBLOX::new_data_ = false
private

Definition at line 507 of file ublox.h.

uint32_t UBLOX::num_errors_ = 0
private

Definition at line 493 of file ublox.h.

volatile uint32_t UBLOX::num_messages_received_ = 0
private

Definition at line 494 of file ublox.h.

UBX_message_t UBLOX::out_message_ = {}
private

Definition at line 480 of file ublox.h.

parse_state_t UBLOX::parse_state_
private

Definition at line 487 of file ublox.h.

NAV_POSECEF_t UBLOX::pos_ecef_ = {}
private

Definition at line 511 of file ublox.h.

uint8_t UBLOX::prev_byte_ = 0
private

Definition at line 503 of file ublox.h.

UART* UBLOX::serial_ = nullptr
private

Definition at line 505 of file ublox.h.

uint64_t UBLOX::time_ = 0
private

Definition at line 500 of file ublox.h.

float UBLOX::vel_[3] = {}
private

Definition at line 497 of file ublox.h.

NAV_VELECEF_t UBLOX::vel_ecef_ = {}
private

Definition at line 512 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 Wed Jul 3 2019 19:59:31