APM:Libraries
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
AP_GPS_UBLOX Class Reference

#include <AP_GPS_UBLOX.h>

Inheritance diagram for AP_GPS_UBLOX:
[legend]
Collaboration diagram for AP_GPS_UBLOX:
[legend]

Classes

union  PACKED
 
struct  ubx_ack_ack
 
struct  ubx_cfg_cfg
 
struct  ubx_cfg_gnss
 
struct  ubx_cfg_msg
 
struct  ubx_cfg_msg_rate
 
struct  ubx_cfg_msg_rate_6
 
struct  ubx_cfg_nav_rate
 
struct  ubx_cfg_nav_settings
 
struct  ubx_cfg_prt
 
struct  ubx_cfg_sbas
 
struct  ubx_header
 
struct  ubx_mon_hw2
 
struct  ubx_mon_hw_60
 
struct  ubx_mon_hw_68
 
struct  ubx_mon_ver
 
struct  ubx_nav_dop
 
struct  ubx_nav_posllh
 
struct  ubx_nav_pvt
 
struct  ubx_nav_solution
 
struct  ubx_nav_status
 
struct  ubx_nav_svinfo_header
 
struct  ubx_nav_velned
 
struct  ubx_rxm_raw
 
struct  ubx_rxm_rawx
 

Public Member Functions

 AP_GPS_UBLOX (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
bool read ()
 
AP_GPS::GPS_Status highest_supported_status (void)
 
bool is_configured (void)
 
void broadcast_configuration_failure_reason (void) const override
 
void Write_DataFlash_Log_Startup_messages () const override
 
bool get_lag (float &lag_sec) const override
 
const char * name () const override
 
- Public Member Functions inherited from AP_GPS_Backend
 AP_GPS_Backend (AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
 
virtual ~AP_GPS_Backend (void)
 
virtual void inject_data (const uint8_t *data, uint16_t len)
 
virtual bool supports_mavlink_gps_rtk_message ()
 
virtual void send_mavlink_gps_rtk (mavlink_channel_t chan)
 
virtual void handle_msg (const mavlink_message_t *msg)
 
virtual void handle_gnss_msg (const AP_GPS::GPS_State &msg)
 
virtual bool is_healthy (void) const
 
void broadcast_gps_type () const
 
virtual bool prepare_for_arming (void)
 

Static Public Member Functions

static bool _detect (struct UBLOX_detect_state &state, uint8_t data)
 

Private Types

enum  ubs_protocol_bytes {
  PREAMBLE1 = 0xb5, PREAMBLE2 = 0x62, CLASS_NAV = 0x01, CLASS_ACK = 0x05,
  CLASS_CFG = 0x06, CLASS_MON = 0x0A, CLASS_RXM = 0x02, MSG_ACK_NACK = 0x00,
  MSG_ACK_ACK = 0x01, MSG_POSLLH = 0x2, MSG_STATUS = 0x3, MSG_DOP = 0x4,
  MSG_SOL = 0x6, MSG_PVT = 0x7, MSG_VELNED = 0x12, MSG_CFG_CFG = 0x09,
  MSG_CFG_RATE = 0x08, MSG_CFG_MSG = 0x01, MSG_CFG_NAV_SETTINGS = 0x24, MSG_CFG_PRT = 0x00,
  MSG_CFG_SBAS = 0x16, MSG_CFG_GNSS = 0x3E, MSG_MON_HW = 0x09, MSG_MON_HW2 = 0x0B,
  MSG_MON_VER = 0x04, MSG_NAV_SVINFO = 0x30, MSG_RXM_RAW = 0x10, MSG_RXM_RAWX = 0x15
}
 
enum  ubx_gnss_identifier {
  GNSS_GPS = 0x00, GNSS_SBAS = 0x01, GNSS_GALILEO = 0x02, GNSS_BEIDOU = 0x03,
  GNSS_IMES = 0x04, GNSS_QZSS = 0x05, GNSS_GLONASS = 0x06
}
 
enum  ubs_nav_fix_type {
  FIX_NONE = 0, FIX_DEAD_RECKONING = 1, FIX_2D = 2, FIX_3D = 3,
  FIX_GPS_DEAD_RECKONING = 4, FIX_TIME = 5
}
 
enum  ubx_nav_status_bits { NAV_STATUS_FIX_VALID = 1, NAV_STATUS_DGPS_USED = 2 }
 
enum  ubx_hardware_version {
  ANTARIS = 0, UBLOX_5, UBLOX_6, UBLOX_7,
  UBLOX_M8, UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff
}
 
enum  config_step {
  STEP_PVT = 0, STEP_NAV_RATE, STEP_SOL, STEP_PORT,
  STEP_STATUS, STEP_POSLLH, STEP_VELNED, STEP_POLL_SVINFO,
  STEP_POLL_SBAS, STEP_POLL_NAV, STEP_POLL_GNSS, STEP_DOP,
  STEP_MON_HW, STEP_MON_HW2, STEP_RAW, STEP_RAWX,
  STEP_VERSION, STEP_LAST
}
 

Private Member Functions

bool _parse_gps ()
 
bool _configure_message_rate (uint8_t msg_class, uint8_t msg_id, uint8_t rate)
 
void _configure_rate (void)
 
void _configure_sbas (bool enable)
 
void _update_checksum (uint8_t *data, uint16_t len, uint8_t &ck_a, uint8_t &ck_b)
 
bool _send_message (uint8_t msg_class, uint8_t msg_id, void *msg, uint16_t size)
 
void send_next_rate_update (void)
 
bool _request_message_rate (uint8_t msg_class, uint8_t msg_id)
 
void _request_next_config (void)
 
void _request_port (void)
 
void _request_version (void)
 
void _save_cfg (void)
 
void _verify_rate (uint8_t msg_class, uint8_t msg_id, uint8_t rate)
 
void unexpected_message (void)
 
void log_mon_hw (void)
 
void log_mon_hw2 (void)
 
void log_rxm_raw (const struct ubx_rxm_raw &raw)
 
void log_rxm_rawx (const struct ubx_rxm_rawx &raw)
 
uint8_t _ubx_msg_log_index (uint8_t ubx_msg)
 

Private Attributes

union AP_GPS_UBLOX::PACKED _buffer
 
uint8_t _ck_a
 
uint8_t _ck_b
 
uint8_t _step
 
uint8_t _msg_id
 
uint16_t _payload_length
 
uint16_t _payload_counter
 
uint8_t _class
 
bool _cfg_saved
 
uint32_t _last_vel_time
 
uint32_t _last_pos_time
 
uint32_t _last_cfg_sent_time
 
uint8_t _num_cfg_save_tries
 
uint32_t _last_config_time
 
uint16_t _delay_time
 
uint8_t _next_message
 
uint8_t _ublox_port
 
bool _have_version
 
struct ubx_mon_ver _version
 
uint32_t _unconfigured_messages
 
uint8_t _hardware_generation
 
bool _new_position:1
 
bool _new_speed:1
 
uint8_t _disable_counter
 
AP_GPS::GPS_Status next_fix
 
bool _cfg_needs_save
 
bool noReceivedHdop
 
bool havePvtMsg
 

Additional Inherited Members

- Protected Member Functions inherited from AP_GPS_Backend
int32_t swap_int32 (int32_t v) const
 
int16_t swap_int16 (int16_t v) const
 
void fill_3d_velocity (void)
 
void make_gps_time (uint32_t bcd_date, uint32_t bcd_milliseconds)
 
void _detection_message (char *buffer, uint8_t buflen) const
 
bool should_df_log () const
 
- Protected Attributes inherited from AP_GPS_Backend
AP_HAL::UARTDriverport
 UART we are attached to. More...
 
AP_GPSgps
 access to frontend (for parameters) More...
 
AP_GPS::GPS_Statestate
 public state for this instance More...
 

Detailed Description

Definition at line 92 of file AP_GPS_UBLOX.h.

Member Enumeration Documentation

◆ config_step

Enumerator
STEP_PVT 
STEP_NAV_RATE 
STEP_SOL 
STEP_PORT 
STEP_STATUS 
STEP_POSLLH 
STEP_VELNED 
STEP_POLL_SVINFO 
STEP_POLL_SBAS 
STEP_POLL_NAV 
STEP_POLL_GNSS 
STEP_DOP 
STEP_MON_HW 
STEP_MON_HW2 
STEP_RAW 
STEP_RAWX 
STEP_VERSION 
STEP_LAST 

Definition at line 485 of file AP_GPS_UBLOX.h.

◆ ubs_nav_fix_type

Enumerator
FIX_NONE 
FIX_DEAD_RECKONING 
FIX_2D 
FIX_3D 
FIX_GPS_DEAD_RECKONING 
FIX_TIME 

Definition at line 463 of file AP_GPS_UBLOX.h.

◆ ubs_protocol_bytes

Enumerator
PREAMBLE1 
PREAMBLE2 
CLASS_NAV 
CLASS_ACK 
CLASS_CFG 
CLASS_MON 
CLASS_RXM 
MSG_ACK_NACK 
MSG_ACK_ACK 
MSG_POSLLH 
MSG_STATUS 
MSG_DOP 
MSG_SOL 
MSG_PVT 
MSG_VELNED 
MSG_CFG_CFG 
MSG_CFG_RATE 
MSG_CFG_MSG 
MSG_CFG_NAV_SETTINGS 
MSG_CFG_PRT 
MSG_CFG_SBAS 
MSG_CFG_GNSS 
MSG_MON_HW 
MSG_MON_HW2 
MSG_MON_VER 
MSG_NAV_SVINFO 
MSG_RXM_RAW 
MSG_RXM_RAWX 

Definition at line 424 of file AP_GPS_UBLOX.h.

◆ ubx_gnss_identifier

Enumerator
GNSS_GPS 
GNSS_SBAS 
GNSS_GALILEO 
GNSS_BEIDOU 
GNSS_IMES 
GNSS_QZSS 
GNSS_GLONASS 

Definition at line 454 of file AP_GPS_UBLOX.h.

◆ ubx_hardware_version

Enumerator
ANTARIS 
UBLOX_5 
UBLOX_6 
UBLOX_7 
UBLOX_M8 
UBLOX_UNKNOWN_HARDWARE_GENERATION 

Definition at line 475 of file AP_GPS_UBLOX.h.

◆ ubx_nav_status_bits

Enumerator
NAV_STATUS_FIX_VALID 
NAV_STATUS_DGPS_USED 

Definition at line 471 of file AP_GPS_UBLOX.h.

Constructor & Destructor Documentation

◆ AP_GPS_UBLOX()

AP_GPS_UBLOX::AP_GPS_UBLOX ( AP_GPS _gps,
AP_GPS::GPS_State _state,
AP_HAL::UARTDriver _port 
)

Definition at line 46 of file AP_GPS_UBLOX.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _configure_message_rate()

bool AP_GPS_UBLOX::_configure_message_rate ( uint8_t  msg_class,
uint8_t  msg_id,
uint8_t  rate 
)
private

Definition at line 1156 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps(), _verify_rate(), and unexpected_message().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _configure_rate()

void AP_GPS_UBLOX::_configure_rate ( void  )
private

Definition at line 1257 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _configure_sbas()

void AP_GPS_UBLOX::_configure_sbas ( bool  enable)
private

◆ _detect()

bool AP_GPS_UBLOX::_detect ( struct UBLOX_detect_state state,
uint8_t  data 
)
static

Definition at line 1193 of file AP_GPS_UBLOX.cpp.

Referenced by AP_GPS::detect_instance(), and highest_supported_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_gps()

bool AP_GPS_UBLOX::_parse_gps ( void  )
private

Definition at line 592 of file AP_GPS_UBLOX.cpp.

Referenced by read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _request_message_rate()

bool AP_GPS_UBLOX::_request_message_rate ( uint8_t  msg_class,
uint8_t  msg_id 
)
private

Definition at line 1136 of file AP_GPS_UBLOX.cpp.

Referenced by _request_next_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _request_next_config()

void AP_GPS_UBLOX::_request_next_config ( void  )
private

Definition at line 63 of file AP_GPS_UBLOX.cpp.

Referenced by AP_GPS_UBLOX(), and read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _request_port()

void AP_GPS_UBLOX::_request_port ( void  )
private

Definition at line 309 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps(), _request_message_rate(), and _request_next_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _request_version()

void AP_GPS_UBLOX::_request_version ( void  )
private

Definition at line 1251 of file AP_GPS_UBLOX.cpp.

Referenced by _request_next_config().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _save_cfg()

void AP_GPS_UBLOX::_save_cfg ( void  )
private

Definition at line 1174 of file AP_GPS_UBLOX.cpp.

Referenced by read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _send_message()

bool AP_GPS_UBLOX::_send_message ( uint8_t  msg_class,
uint8_t  msg_id,
void *  msg,
uint16_t  size 
)
private

Definition at line 1107 of file AP_GPS_UBLOX.cpp.

Referenced by _configure_message_rate(), _configure_rate(), _parse_gps(), _request_message_rate(), _request_next_config(), _request_port(), _request_version(), and _save_cfg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _ubx_msg_log_index()

uint8_t AP_GPS_UBLOX::_ubx_msg_log_index ( uint8_t  ubx_msg)
inlineprivate

Definition at line 572 of file AP_GPS_UBLOX.h.

Referenced by log_mon_hw(), and log_mon_hw2().

Here is the caller graph for this function:

◆ _update_checksum()

void AP_GPS_UBLOX::_update_checksum ( uint8_t *  data,
uint16_t  len,
uint8_t &  ck_a,
uint8_t &  ck_b 
)
private

Definition at line 1093 of file AP_GPS_UBLOX.cpp.

Referenced by _send_message().

Here is the caller graph for this function:

◆ _verify_rate()

void AP_GPS_UBLOX::_verify_rate ( uint8_t  msg_class,
uint8_t  msg_id,
uint8_t  rate 
)
private

Definition at line 193 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcast_configuration_failure_reason()

void AP_GPS_UBLOX::broadcast_configuration_failure_reason ( void  ) const
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 1284 of file AP_GPS_UBLOX.cpp.

Referenced by is_configured().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_lag()

bool AP_GPS_UBLOX::get_lag ( float &  lag_sec) const
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 1297 of file AP_GPS_UBLOX.cpp.

Referenced by is_configured().

Here is the caller graph for this function:

◆ highest_supported_status()

AP_GPS::GPS_Status AP_GPS_UBLOX::highest_supported_status ( void  )
inlinevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 100 of file AP_GPS_UBLOX.h.

Here is the call graph for this function:

◆ is_configured()

bool AP_GPS_UBLOX::is_configured ( void  )
inlinevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 104 of file AP_GPS_UBLOX.h.

Here is the call graph for this function:

◆ log_mon_hw()

void AP_GPS_UBLOX::log_mon_hw ( void  )
private

Definition at line 468 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_mon_hw2()

void AP_GPS_UBLOX::log_mon_hw2 ( void  )
private

Definition at line 492 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_rxm_raw()

void AP_GPS_UBLOX::log_rxm_raw ( const struct ubx_rxm_raw raw)
private

Definition at line 511 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_rxm_rawx()

void AP_GPS_UBLOX::log_rxm_rawx ( const struct ubx_rxm_rawx raw)
private

Definition at line 537 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

const char* AP_GPS_UBLOX::name ( ) const
inlineoverridevirtual

Implements AP_GPS_Backend.

Definition at line 122 of file AP_GPS_UBLOX.h.

◆ read()

bool AP_GPS_UBLOX::read ( void  )
virtual

Implements AP_GPS_Backend.

Definition at line 328 of file AP_GPS_UBLOX.cpp.

Here is the call graph for this function:

◆ send_next_rate_update()

void AP_GPS_UBLOX::send_next_rate_update ( void  )
private

◆ unexpected_message()

void AP_GPS_UBLOX::unexpected_message ( void  )
private

Definition at line 578 of file AP_GPS_UBLOX.cpp.

Referenced by _parse_gps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_DataFlash_Log_Startup_messages()

void AP_GPS_UBLOX::Write_DataFlash_Log_Startup_messages ( ) const
overridevirtual

Reimplemented from AP_GPS_Backend.

Definition at line 1320 of file AP_GPS_UBLOX.cpp.

Referenced by is_configured().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _buffer

union AP_GPS_UBLOX::PACKED AP_GPS_UBLOX::_buffer
private

◆ _cfg_needs_save

bool AP_GPS_UBLOX::_cfg_needs_save
private

Definition at line 546 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), _verify_rate(), and read().

◆ _cfg_saved

bool AP_GPS_UBLOX::_cfg_saved
private

Definition at line 517 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), and read().

◆ _ck_a

uint8_t AP_GPS_UBLOX::_ck_a
private

Definition at line 507 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _ck_b

uint8_t AP_GPS_UBLOX::_ck_b
private

Definition at line 508 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _class

uint8_t AP_GPS_UBLOX::_class
private

Definition at line 516 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), read(), and unexpected_message().

◆ _delay_time

uint16_t AP_GPS_UBLOX::_delay_time
private

Definition at line 524 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _disable_counter

uint8_t AP_GPS_UBLOX::_disable_counter
private

Definition at line 538 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), and unexpected_message().

◆ _hardware_generation

uint8_t AP_GPS_UBLOX::_hardware_generation
private

Definition at line 530 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), _request_next_config(), and get_lag().

◆ _have_version

bool AP_GPS_UBLOX::_have_version
private

◆ _last_cfg_sent_time

uint32_t AP_GPS_UBLOX::_last_cfg_sent_time
private

Definition at line 521 of file AP_GPS_UBLOX.h.

Referenced by _save_cfg(), and read().

◆ _last_config_time

uint32_t AP_GPS_UBLOX::_last_config_time
private

Definition at line 523 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _last_pos_time

uint32_t AP_GPS_UBLOX::_last_pos_time
private

Definition at line 520 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().

◆ _last_vel_time

uint32_t AP_GPS_UBLOX::_last_vel_time
private

Definition at line 519 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().

◆ _msg_id

uint8_t AP_GPS_UBLOX::_msg_id
private

Definition at line 512 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), read(), and unexpected_message().

◆ _new_position

bool AP_GPS_UBLOX::_new_position
private

Definition at line 534 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().

◆ _new_speed

bool AP_GPS_UBLOX::_new_speed
private

Definition at line 536 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().

◆ _next_message

uint8_t AP_GPS_UBLOX::_next_message
private

Definition at line 525 of file AP_GPS_UBLOX.h.

Referenced by _request_next_config().

◆ _num_cfg_save_tries

uint8_t AP_GPS_UBLOX::_num_cfg_save_tries
private

Definition at line 522 of file AP_GPS_UBLOX.h.

Referenced by _save_cfg(), and read().

◆ _payload_counter

uint16_t AP_GPS_UBLOX::_payload_counter
private

Definition at line 514 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _payload_length

uint16_t AP_GPS_UBLOX::_payload_length
private

Definition at line 513 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), log_mon_hw(), and read().

◆ _step

uint8_t AP_GPS_UBLOX::_step
private

Definition at line 511 of file AP_GPS_UBLOX.h.

Referenced by read().

◆ _ublox_port

uint8_t AP_GPS_UBLOX::_ublox_port
private

Definition at line 526 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), and _request_message_rate().

◆ _unconfigured_messages

uint32_t AP_GPS_UBLOX::_unconfigured_messages
private

◆ _version

struct ubx_mon_ver AP_GPS_UBLOX::_version
private

Definition at line 528 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), and Write_DataFlash_Log_Startup_messages().

◆ havePvtMsg

bool AP_GPS_UBLOX::havePvtMsg
private

Definition at line 550 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps(), _verify_rate(), and read().

◆ next_fix

AP_GPS::GPS_Status AP_GPS_UBLOX::next_fix
private

Definition at line 544 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().

◆ noReceivedHdop

bool AP_GPS_UBLOX::noReceivedHdop
private

Definition at line 548 of file AP_GPS_UBLOX.h.

Referenced by _parse_gps().


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