mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 12:06:34 +00:00
Register MAVSDK::Telemetry::Position type for Qt
Without this application can't get position events in Qt5 based systems. Type: Improvement
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QMetaProperty>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
|
||||
@@ -74,6 +75,7 @@ bool AzDroneController::stateTelemetryModule(void)
|
||||
|
||||
// Subscripe to position updates. Updated comes from different MAVSDK thread. Send position
|
||||
// as signal to this class (Qt::QueuedConnection) so that it's handled in the main thread.
|
||||
qRegisterMetaType<Telemetry::Position>("Telemetry::Position");
|
||||
connect(this, &AzDroneController::newPosition, this, &AzDroneController::newPositionSlot, Qt::QueuedConnection);
|
||||
mTelemetry->subscribe_position([this](Telemetry::Position position) { emit newPosition(position); });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user