16 , _requestStop(requestStop)
19 qCDebug(GPSProviderLog) << QStringLiteral(
"Survey in accuracy: %1 | duration: %2").arg(_config.surveyInAccMeters).arg(_config.surveyInDurationSecs);
22void GPSProvider::run()
24#ifdef SIMULATE_RTCM_OUTPUT
31 if (!transport.open()) {
42 sinks.
onRTCM = [
this, &gotData](
const QByteArray &message) {
48 qCDebug(GPSProviderLog) << QStringLiteral(
"Survey-in: %1s accuracy: %2mm valid: %3 active: %4")
49 .arg(status.durationSecs).arg(status.meanAccuracyMM).arg(status.valid).arg(status.active);
53 GPSDriver driver(_type, transport, _config, std::move(sinks));
55 bool configErrorReported =
false;
56 while (!_requestStop) {
57 if (!driver.configure()) {
61 if (!configErrorReported) {
63 configErrorReported =
true;
65 msleep(kConfigRetryDelayMs);
68 configErrorReported =
false;
70 uint8_t idleCycles = 0;
71 while (!_requestStop && (idleCycles < kMaxIdleReceiveCycles)) {
73 const int ret = driver.receive(kGPSReceiveTimeout);
74 const bool progress = (ret > 0) || gotData;
75 idleCycles = progress ? 0 : (idleCycles + 1);
78 if (transport.fatalError()) {
84 qCDebug(GPSProviderLog) <<
"Exiting GPS thread";
@ ConfigFailed
receiver did not accept configuration
@ DeviceError
fatal serial error after a working connection
@ OpenFailed
serial device could not be opened
GPSType
Receiver families QGC can drive via the px4-gpsdrivers library.
#define QGC_LOGGING_CATEGORY(name, categoryStr)
void RTCMDataUpdate(const QByteArray &message)
void sensorGpsUpdate(const sensor_gps_s &message)
void satelliteInfoUpdate(const satellite_info_s &message)
void surveyInStatus(const GPSSurveyInStatus &status)
void connectionError(GPSConnectionError error)
void sendSimulatedData(const std::atomic_bool &requestStop)
std::function< void(const sensor_gps_s &)> onPosition
std::function< void(const satellite_info_s &)> onSatelliteInfo
std::function< void(const GPSSurveyInStatus &)> onSurveyIn
std::function< void(const QByteArray &)> onRTCM
RTK base-station configuration, decoupled from QGC settings types.
Survey-in progress, translated from the px4 SurveyInStatus.