QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TerrainQueryCoordinator.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QElapsedTimer>
4#include <QtCore/QList>
5#include <QtCore/QObject>
6#include <QtCore/QPointer>
7#include <QtPositioning/QGeoCoordinate>
8
10class Vehicle;
11
23class TerrainQueryCoordinator : public QObject
24{
25 Q_OBJECT
26
27public:
28 explicit TerrainQueryCoordinator(Vehicle* vehicle);
29
32 void doSetHomeWithTerrain(const QGeoCoordinate& coord);
33
37
38private slots:
39 void _doSetHomeTerrainReceived(bool success, QList<double> heights);
40 void _altitudeAboveTerrainReceived(bool success, QList<double> heights);
41
42private:
43 Vehicle* _vehicle = nullptr;
44
45 // QPointer: TerrainAtCoordinateQuery self-deletes after its signal (autoDelete=true).
46 QPointer<TerrainAtCoordinateQuery> _doSetHomeQuery;
47 QGeoCoordinate _doSetHomeCoordinate;
48
49 QElapsedTimer _altQueryTimer;
50 QPointer<TerrainAtCoordinateQuery> _altQuery;
51 QGeoCoordinate _altLastCoord;
52 float _altLastRelAlt = qQNaN();
53};
NOTE: TerrainAtCoordinateQuery is not thread safe. All instances/calls to ElevationProvider must be o...
Coordinates the terrain-query workflows attached to a Vehicle:
void doSetHomeWithTerrain(const QGeoCoordinate &coord)