QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FollowMe.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QTimer>
5#include <QtCore/QVariant>
6
7class Vehicle;
8
9class FollowMe : public QObject
10{
11 Q_OBJECT
12 Q_MOC_INCLUDE("Vehicle.h")
13
14public:
15 explicit FollowMe(QObject *parent = nullptr);
16 ~FollowMe();
17
18 static FollowMe* instance();
19 void init();
20
22 int lat_int; // X Position in WGS84 frame in 1e7 * meters
23 int lon_int; // Y Position in WGS84 frame in 1e7 * meters
24 double altMetersAMSL; // Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
25 double headingDegrees; // Heading in degrees
26 double vxMetersPerSec; // X velocity in NED frame in meter / s
27 double vyMetersPerSec; // Y velocity in NED frame in meter / s
28 double vzMetersPerSec; // Z velocity in NED frame in meter / s
29 double pos_std_dev[3]; // -1 for unknown
30 };
31
34 POS = 0,
35 VEL = 1,
36 ACCEL = 2,
38 HEADING = 4
39 };
40
41private slots:
42 void _sendGCSMotionReport();
43 void _settingsChanged(QVariant value);
44 void _vehicleAdded(Vehicle *vehicle);
45 void _vehicleRemoved(Vehicle *vehicle);
46 void _enableIfVehicleInFollow();
47
48private:
49 enum FollowMode {
50 MODE_NEVER,
51 MODE_ALWAYS,
52 MODE_FOLLOWME
53 };
54
55 void _disableFollowSend();
56 void _enableFollowSend();
57 bool _isFollowFlightMode(const Vehicle *vehicle, const QString &flightMode);
58
59 QTimer *_gcsMotionReportTimer = nullptr;
60 FollowMode _currentMode = MODE_NEVER;
61
62 static constexpr int kMotionUpdateInterval = 250;
63};
static FollowMe * instance()
Definition FollowMe.cc:35
~FollowMe()
Definition FollowMe.cc:30
void init()
Definition FollowMe.cc:40
MotionCapability
Mavlink defined motion reporting capabilities.
Definition FollowMe.h:33
@ ATT_RATES
Definition FollowMe.h:37
@ HEADING
Definition FollowMe.h:38