QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ArduCopterFirmwarePlugin.h
Go to the documentation of this file.
1#pragma once
2
3#include "APMFirmwarePlugin.h"
4
6{
7 enum Mode : uint32_t{
8 STABILIZE = 0, // hold level position
9 ACRO = 1, // rate control
10 ALT_HOLD = 2, // AUTO control
11 AUTO = 3, // AUTO control
12 GUIDED = 4, // AUTO control
13 LOITER = 5, // Hold a single location
14 RTL = 6, // AUTO control
15 CIRCLE = 7, // AUTO control
16 POSITION = 8, // Deprecated
17 LAND = 9, // AUTO control
18 OF_LOITER = 10, // Deprecated
19 DRIFT = 11, // Drift 'Car Like' mode
20 RESERVED_12 = 12, // RESERVED FOR FUTURE USE
21 SPORT = 13,
22 FLIP = 14,
24 POS_HOLD = 16, // HYBRID LOITER.
25 BRAKE = 17,
26 THROW = 18,
29 SMART_RTL = 21, // SMART_RTL returns to home by retracing its steps
30 FLOWHOLD = 22, // FLOWHOLD holds position with optical flow without rangefinder
31 FOLLOW = 23, // follow attempts to follow another vehicle or ground station
32 ZIGZAG = 24, // ZIGZAG mode is able to fly in a zigzag manner with predefined point A and point B
36 TURTLE = 28,
37 };
38};
39
41{
42 Q_OBJECT
43
44public:
45 explicit ArduCopterFirmwarePlugin(QObject *parent = nullptr);
47
48 void guidedModeLand(Vehicle *vehicle) const override { _setFlightModeAndValidate(vehicle, landFlightMode()); }
49 const FirmwarePlugin::remapParamNameMajorVersionMap_t &paramNameRemapMajorVersionMap() const override { return _remapParamName; }
50 int remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const override;
51 bool multiRotorCoaxialMotors(Vehicle* /*vehicle*/) const override { return _coaxialMotors; }
52 bool multiRotorXConfig(Vehicle *vehicle) const override;
53 QString offlineEditingParamFile(Vehicle *vehicle) const override { Q_UNUSED(vehicle); return QStringLiteral(":/FirmwarePlugin/APM/Copter.OfflineEditing.params"); }
54 QString pauseFlightMode() const override;
55 QString landFlightMode() const override;
56 QString takeControlFlightMode() const override;
57 QString followFlightMode() const override;
58 QString gotoFlightMode() const override { return guidedFlightMode(); }
59 QString takeOffFlightMode() const override { return guidedFlightMode(); }
60 QString stabilizedFlightMode() const override;
61 QString autoDisarmParameter(Vehicle *vehicle) const override { Q_UNUSED(vehicle); return QStringLiteral("DISARM_DELAY"); }
62 bool supportsSmartRTL() const override { return true; }
63
64 void updateAvailableFlightModes(FlightModeList &modeList) override;
65
66protected:
67 uint32_t _convertToCustomFlightModeEnum(uint32_t val) const override;
68
69private:
70 const QString _stabilizeFlightMode = tr("Stabilize");
71 const QString _acroFlightMode = tr("Acro");
72 const QString _altHoldFlightMode = tr("Altitude Hold");
73 const QString _autoFlightMode = tr("Auto");
74 const QString _guidedFlightMode = tr("Guided");
75 const QString _loiterFlightMode = tr("Loiter");
76 const QString _rtlFlightMode = tr("RTL");
77 const QString _circleFlightMode = tr("Circle");
78 const QString _landFlightMode = tr("Land");
79 const QString _driftFlightMode = tr("Drift");
80 const QString _sportFlightMode = tr("Sport");
81 const QString _flipFlightMode = tr("Flip");
82 const QString _autotuneFlightMode = tr("Autotune");
83 const QString _posHoldFlightMode = tr("Position Hold");
84 const QString _brakeFlightMode = tr("Brake");
85 const QString _throwFlightMode = tr("Throw");
86 const QString _avoidADSBFlightMode = tr("Avoid ADSB");
87 const QString _guidedNoGPSFlightMode = tr("Guided No GPS");
88 const QString _smartRtlFlightMode = tr("Smart RTL");
89 const QString _flowHoldFlightMode = tr("Flow Hold");
90 const QString _followFlightMode = tr("Follow");
91 const QString _zigzagFlightMode = tr("ZigZag");
92 const QString _systemIDFlightMode = tr("SystemID");
93 const QString _autoRotateFlightMode = tr("AutoRotate");
94 const QString _autoRTLFlightMode = tr("AutoRTL");
95 const QString _turtleFlightMode = tr("Turtle");
96
97 static bool _remapParamNameIntialized;
99};
QList< FirmwareFlightMode > FlightModeList
This is the base class for all stack specific APM firmware plugins.
virtual QString guidedFlightMode() const
const FirmwarePlugin::remapParamNameMajorVersionMap_t & paramNameRemapMajorVersionMap() const override
Returns the mapping structure which is used to map from one parameter name to another based on firmwa...
void guidedModeLand(Vehicle *vehicle) const override
Command vehicle to land at current location.
bool supportsSmartRTL() const override
uint32_t _convertToCustomFlightModeEnum(uint32_t val) const override
void updateAvailableFlightModes(FlightModeList &modeList) override
Update Available flight modes recieved from vehicle.
QString followFlightMode() const override
Returns the flight mode which the vehicle will be for follow me.
QString gotoFlightMode() const override
Returns the flight mode which the vehicle will be in if it is performing a goto location.
int remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const override
Returns the highest major version number that is known to the remap for this specified major version.
QString landFlightMode() const override
Returns the flight mode for Land.
QString autoDisarmParameter(Vehicle *vehicle) const override
QString takeOffFlightMode() const override
Returns the flight mode for TakeOff.
QString stabilizedFlightMode() const override
Returns the flight mode for Stabilized.
bool multiRotorXConfig(Vehicle *vehicle) const override
QString pauseFlightMode() const override
Returns The flight mode which indicates the vehicle is paused.
QString offlineEditingParamFile(Vehicle *vehicle) const override
Return the resource file which contains the set of params loaded for offline editing.
bool multiRotorCoaxialMotors(Vehicle *) const override
QString takeControlFlightMode() const override
Returns the flight mode to use when the operator wants to take back control from autonomouse flight.
bool _setFlightModeAndValidate(Vehicle *vehicle, const QString &flightMode) const
QMap< int, remapParamNameMinorVersionRemapMap_t > remapParamNameMajorVersionMap_t