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