AP_GPS: fixed u-blox F9 auto configuration

# Conflicts:
#	libraries/AP_GPS/AP_GPS_UBLOX.cpp
This commit is contained in:
Andrew Tridgell 2019-07-06 08:33:15 +10:00
parent 1cd90e5ae7
commit a91af12364
2 changed files with 22 additions and 2 deletions

View File

@ -73,7 +73,15 @@ AP_GPS_UBLOX::_request_next_config(void)
return; return;
} }
Debug("Unconfigured messages: %d Current message: %d\n", _unconfigured_messages, _next_message); if (_unconfigured_messages == CONFIG_RATE_SOL && havePvtMsg) {
/*
we don't need SOL if we have PVT and TIMEGPS. This is needed
as F9P doesn't support the SOL message
*/
_unconfigured_messages &= ~CONFIG_RATE_SOL;
}
Debug("Unconfigured messages: 0x%x Current message: %u\n", (unsigned)_unconfigured_messages, (unsigned)_next_message);
// check AP_GPS_UBLOX.h for the enum that controls the order. // check AP_GPS_UBLOX.h for the enum that controls the order.
// This switch statement isn't maintained against the enum in order to reduce code churn // This switch statement isn't maintained against the enum in order to reduce code churn
@ -819,6 +827,11 @@ AP_GPS_UBLOX::_parse_gps(void)
state.instance + 1, state.instance + 1,
_version.hwVersion, _version.hwVersion,
_version.swVersion); _version.swVersion);
// check for F9. The F9 does not respond to SVINFO, so we need to use MON_VER
// for hardware generation
if (strncmp(_version.hwVersion, "00190000", 8) == 0) {
_hardware_generation = UBLOX_F9;
}
break; break;
default: default:
unexpected_message(); unexpected_message();
@ -1034,8 +1047,9 @@ AP_GPS_UBLOX::_parse_gps(void)
break; break;
case MSG_TIMEGPS: case MSG_TIMEGPS:
Debug("MSG_TIMEGPS"); Debug("MSG_TIMEGPS");
if (_buffer.timegps.valid & UBX_TIMEGPS_VALID_WEEK_MASK) if (_buffer.timegps.valid & UBX_TIMEGPS_VALID_WEEK_MASK) {
state.time_week = _buffer.timegps.week; state.time_week = _buffer.timegps.week;
}
break; break;
case MSG_VELNED: case MSG_VELNED:
Debug("MSG_VELNED"); Debug("MSG_VELNED");
@ -1334,6 +1348,11 @@ bool AP_GPS_UBLOX::get_lag(float &lag_sec) const
// based on flight logs the 7 and 8 series seem to produce about 120ms lag // based on flight logs the 7 and 8 series seem to produce about 120ms lag
lag_sec = 0.12f; lag_sec = 0.12f;
break; break;
case UBLOX_F9:
// F9 lag not verified yet from flight log, but likely to be at least
// as good as M8
lag_sec = 0.12f;
break;
}; };
return true; return true;
} }

View File

@ -494,6 +494,7 @@ private:
UBLOX_6, UBLOX_6,
UBLOX_7, UBLOX_7,
UBLOX_M8, UBLOX_M8,
UBLOX_F9 = 0x80, // comes from MON_VER hwVersion string
UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for UBLOX_UNKNOWN_HARDWARE_GENERATION = 0xff // not in the ublox spec used for
// flagging state in the driver // flagging state in the driver
}; };