27 #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO || \ 28 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BH 29 #define UBLOX_SPEED_CHANGE 1 31 #define UBLOX_SPEED_CHANGE 0 35 #define UBLOX_DEBUGGING 0 36 #define UBLOX_FAKE_3DLOCK 0 41 # define Debug(fmt, args ...) do {hal.console->printf("%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## args); hal.scheduler->delay(1); } while(0) 43 # define Debug(fmt, args ...) 48 _next_message(STEP_PVT),
51 _hardware_generation(UBLOX_UNKNOWN_HARDWARE_GENERATION),
155 #if UBLOX_RXM_RAW_LOGGING 166 #if UBLOX_RXM_RAW_LOGGING 194 uint8_t desired_rate;
201 if(rate == desired_rate) {
211 if(rate == desired_rate) {
239 if(rate == desired_rate) {
280 #if UBLOX_RXM_RAW_LOGGING 303 #endif // UBLOX_RXM_RAW_LOGGING 361 for (int16_t i = 0; i < numc; i++) {
384 Debug(
"reset %u", __LINE__);
446 Debug(
"bad cka %x should be %x", data,
_ck_a);
454 Debug(
"bad ckb %x should be %x", data,
_ck_b);
510 #if UBLOX_RXM_RAW_LOGGING 518 for (uint8_t i=0; i<raw.
numSV; i++) {
556 for (uint8_t i=0; i<raw.
numMeas; i++) {
576 #endif // UBLOX_RXM_RAW_LOGGING 586 Debug(
"Disabling message 0x%02x 0x%02x", (
unsigned)_class, (
unsigned)_msg_id);
644 Debug(
"Got settings %u min_elev %d drLimit %u\n",
653 Debug(
"Changing engine setting from %u to %u\n",
675 #if UBLOX_GNSS_SETTINGS 679 uint8_t gnssCount = 0;
680 Debug(
"Got GNSS Settings %u %u %u %u:\n",
687 Debug(
" %u %u %u 0x%08x\n",
718 if (!memcmp(&start_gnss, &
_buffer.
gnss,
sizeof(start_gnss))) {
733 Debug(
"Got SBAS settings %u %u %u 0x%x 0x%x\n",
803 "u-blox %d HW: %s SW: %s",
814 #if UBLOX_RXM_RAW_LOGGING 822 #endif // UBLOX_RXM_RAW_LOGGING 846 #if UBLOX_FAKE_3DLOCK 855 Debug(
"MSG_STATUS fix_status=%u fix_type=%u",
878 #if UBLOX_FAKE_3DLOCK 888 #if UBLOX_FAKE_3DLOCK 894 Debug(
"MSG_SOL fix_status=%u fix_type=%u",
926 #if UBLOX_FAKE_3DLOCK 1004 #if UBLOX_FAKE_3DLOCK 1020 Debug(
"MSG_VELNED");
1036 #if UBLOX_FAKE_3DLOCK 1043 Debug(
"MSG_NAV_SVINFO\n");
1044 static const uint8_t HardwareGenerationMask = 0x07;
1054 #if UBLOX_SPEED_CHANGE 1056 Debug(
"Changed speed to 4Mhz for SPI-driven UBlox\n");
1069 Debug(
"Unexpected NAV message 0x%02x", (
unsigned)
_msg_id);
1071 Debug(
"Disabling NAV message 0x%02x", (
unsigned)_msg_id);
1113 uint8_t ck_a=0, ck_b=0;
1123 port->
write((
const uint8_t *)&header,
sizeof(header));
1124 port->
write((
const uint8_t *)msg, size);
1184 "GPS: u-blox %d saving config",
1196 switch (state.
step) {
1214 state.
ck_b += (state.
ck_a += data);
1218 state.
ck_b += (state.
ck_a += data);
1223 state.
ck_b += (state.
ck_a += data);
1227 state.
ck_b += (state.
ck_a += data);
1233 if (state.
ck_a != data) {
1240 if (state.
ck_b == data) {
1267 static const char *
reasons[] = {
"navigation rate",
1277 "navigation settings",
1287 gcs().
send_text(MAV_SEVERITY_INFO,
"GPS %d: u-blox %s configuration 0x%02x",
ubx_cfg_msg_rate_6 msg_rate_6
float norm(const T first, const U second, const Params... parameters)
bool get_soft_armed() const
uint32_t time_week_ms
GPS time (milliseconds from start of GPS week)
void Log_Write_MessageF(const char *fmt,...)
void send_blob_start(uint8_t instance, const char *_blob, uint16_t size)
#define CONFIG_RATE_STATUS
PACKED struct AP_GPS_UBLOX::ubx_cfg_gnss::configBlock configBlock[UBLOX_MAX_GNSS_CONFIG_BLOCKS]
#define Debug(fmt, args ...)
AP_GPS_UBLOX(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port)
uint32_t last_gps_time_ms
the system time we got the last GPS timestamp, milliseconds
bool _send_message(uint8_t msg_class, uint8_t msg_id, void *msg, uint16_t size)
void Write_DataFlash_Log_Startup_messages() const override
#define CONFIG_RATE_VELNED
AP_HAL::UARTDriver * console
virtual void begin(uint32_t baud)=0
#define UBLOX_MAX_GNSS_CONFIG_BLOCKS
GPS_Status status
driver fix status
PACKED struct AP_GPS_UBLOX::ubx_rxm_rawx::ubx_rxm_rawx_sv svinfo[UBLOX_MAX_RXM_RAWX_SATS]
Interface definition for the various Ground Control System.
bool have_vertical_velocity
does GPS give vertical velocity? Set to true only once available.
Vector3f velocity
3D velocity in m/s, in NED format
void log_rxm_raw(const struct ubx_rxm_raw &raw)
void log_rxm_rawx(const struct ubx_rxm_rawx &raw)
uint32_t _last_config_time
void WriteBlock(const void *pBuffer, uint16_t size)
virtual uint32_t txspace()=0
uint32_t _last_cfg_sent_time
static const char * reasons[]
uint32_t _unconfigured_messages
ubx_cfg_msg_rate msg_rate
#define CONFIG_NAV_SETTINGS
uint32_t horizontal_accuracy
int32_t lat
param 3 - Latitude * 10**7
Receiving valid messages and 3D RTK Fixed.
union AP_GPS_UBLOX::PACKED _buffer
ubx_cfg_nav_rate nav_rate
#define CONFIG_RATE_POSLLH
AP_GPS & gps
access to frontend (for parameters)
virtual void printf(const char *,...) FMT_PRINTF(2
#define CONFIG_RATE_MON_HW2
float wrap_360(const T angle, float unit_mod)
void unexpected_message(void)
int32_t alt
param 2 - Altitude in centimeters (meters * 100) see LOCATION_ALT_MAX_M
Receiving valid messages and 3D lock with differential improvements.
bool _request_message_rate(uint8_t msg_class, uint8_t msg_id)
Receiving valid messages and 3D RTK Float.
virtual size_t write(uint8_t)=0
void _update_checksum(uint8_t *data, uint16_t len, uint8_t &ck_a, uint8_t &ck_b)
DEFINE_BYTE_ARRAY_METHODS ubx_nav_posllh posllh
static DataFlash_Class * instance(void)
void broadcast_configuration_failure_reason(void) const override
static bool _detect(struct UBLOX_detect_state &state, uint8_t data)
void _verify_rate(uint8_t msg_class, uint8_t msg_id, uint8_t rate)
AP_Int16 _rate_ms[GPS_MAX_RECEIVERS]
uint16_t time_week
GPS week number.
Receiving valid messages and 2D lock.
AP_GPS::GPS_State & state
public state for this instance
void send_text(MAV_SEVERITY severity, const char *fmt,...)
struct ubx_mon_ver _version
bool should_df_log() const
void _request_next_config(void)
uint16_t _payload_counter
void _configure_rate(void)
uint16_t vdop
vertical dilution of precision in cm
uint32_t vertical_accuracy
virtual uint32_t available()=0
Location location
last fix location
int32_t lng
param 4 - Longitude * 10**7
bool get_lag(float &lag_sec) const override
ubx_cfg_nav_settings nav_settings
uint8_t _ubx_msg_log_index(uint8_t ubx_msg)
AP_Int8 _gnss_mode[GPS_MAX_RECEIVERS]
Receiving valid GPS messages but no lock.
ubx_nav_svinfo_header svinfo_header
bool have_vertical_accuracy
does GPS give vertical position accuracy? Set to true only once available.
float speed_accuracy
3D velocity RMS accuracy estimate in m/s
AP_HAL::UARTDriver * port
UART we are attached to.
uint8_t _hardware_generation
bool have_horizontal_accuracy
does GPS give horizontal position accuracy? Set to true only once available.
float horizontal_accuracy
horizontal RMS accuracy estimate in m
float ground_speed
ground speed in m/sec
bool _configure_message_rate(uint8_t msg_class, uint8_t msg_id, uint8_t rate)
virtual void Write_DataFlash_Log_Startup_messages() const
ubx_nav_solution solution
Receiving valid messages and 3D lock.
#define CONFIG_REQUIRED_INITIAL
float vertical_accuracy
vertical RMS accuracy estimate in m
uint16_t get_rate_ms(uint8_t instance) const
uint16_t hdop
horizontal dilution of precision in cm
#define LOG_PACKET_HEADER_INIT(id)
AP_GPS::GPS_Status next_fix
struct AP_GPS_UBLOX::ubx_rxm_raw::ubx_rxm_raw_sv svinfo[UBLOX_MAX_RXM_RAW_SATS]
uint8_t _num_cfg_save_tries
#define CONFIG_RATE_MON_HW
void _request_version(void)
uint8_t num_sats
Number of visible satellites.
bool have_speed_accuracy
does GPS give speed accuracy? Set to true only once available.
float ground_course
ground course in degrees