1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "ArduRoverFirmwarePlugin.h"
#include "QGCApplication.h"
bool ArduRoverFirmwarePlugin::_remapParamNameIntialized = false;
FirmwarePlugin::remapParamNameMajorVersionMap_t ArduRoverFirmwarePlugin::_remapParamName;
APMRoverMode::APMRoverMode(uint32_t mode, bool settable)
: APMCustomMode(mode, settable)
{
setEnumToStringMapping({
{MANUAL, "Manual"},
{ACRO, "Acro"},
{STEERING, "Steering"},
{HOLD, "Hold"},
{LOITER, "Loiter"},
{FOLLOW, "Follow"},
{SIMPLE, "Simple"},
{AUTO, "Auto"},
{RTL, "RTL"},
{SMART_RTL, "Smart RTL"},
{GUIDED, "Guided"},
{INITIALIZING, "Initializing"},
});
}
ArduRoverFirmwarePlugin::ArduRoverFirmwarePlugin(void)
{
setSupportedModes({
APMRoverMode(APMRoverMode::MANUAL ,true),
APMRoverMode(APMRoverMode::ACRO ,true),
APMRoverMode(APMRoverMode::STEERING ,true),
APMRoverMode(APMRoverMode::HOLD ,true),
APMRoverMode(APMRoverMode::LOITER ,true),
APMRoverMode(APMRoverMode::FOLLOW ,true),
APMRoverMode(APMRoverMode::SIMPLE ,true),
APMRoverMode(APMRoverMode::AUTO ,true),
APMRoverMode(APMRoverMode::RTL ,true),
APMRoverMode(APMRoverMode::SMART_RTL ,true),
APMRoverMode(APMRoverMode::GUIDED ,true),
APMRoverMode(APMRoverMode::INITIALIZING ,false),
});
if (!_remapParamNameIntialized) {
FirmwarePlugin::remapParamNameMap_t& remapV3_5 = _remapParamName[3][5];
remapV3_5["BATT_ARM_VOLT"] = QStringLiteral("ARMING_VOLT_MIN");
remapV3_5["BATT2_ARM_VOLT"] = QStringLiteral("ARMING_VOLT2_MIN");
_remapParamNameIntialized = true;
}
}
int ArduRoverFirmwarePlugin::remapParamNameHigestMinorVersionNumber(int majorVersionNumber) const
{
// Remapping supports up to 3.5
return majorVersionNumber == 3 ? 5 : Vehicle::versionNotSetValue;
}
void ArduRoverFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange)
{
Q_UNUSED(vehicle);
Q_UNUSED(altitudeChange);
qgcApp()->showMessage(QStringLiteral("Change altitude not supported."));
}
bool ArduRoverFirmwarePlugin::supportsNegativeThrust(Vehicle* /*vehicle*/)
{
return true;
}
void ArduRoverFirmwarePlugin::sendGCSMotionReport(Vehicle* vehicle, FollowMe::GCSMotionReport& motionReport, uint8_t estimatationCapabilities)
{
_sendGCSMotionReport(vehicle, motionReport, estimatationCapabilities);
}