mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
OP-1391 - Fix to prevent arming if unsafe due to current Thrust Mode (Altitude Hold/Vario)
This commit is contained in:
parent
01b01052a8
commit
3aaf1a3367
@ -35,6 +35,7 @@
|
||||
#include <accessorydesired.h>
|
||||
#include <flightstatus.h>
|
||||
#include <flightmodesettings.h>
|
||||
#include <stabilizationdesired.h>
|
||||
|
||||
// Private constants
|
||||
#define ARMED_THRESHOLD 0.50f
|
||||
@ -267,6 +268,8 @@ static bool okToArm(void)
|
||||
}
|
||||
}
|
||||
|
||||
StabilizationDesiredStabilizationModeData stabDesired;
|
||||
|
||||
uint8_t flightMode;
|
||||
FlightStatusFlightModeGet(&flightMode);
|
||||
switch (flightMode) {
|
||||
@ -277,8 +280,14 @@ static bool okToArm(void)
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED4:
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED5:
|
||||
case FLIGHTSTATUS_FLIGHTMODE_STABILIZED6:
|
||||
return true;
|
||||
|
||||
// Prevent arming if unsafe due to the current Thrust Mode
|
||||
StabilizationDesiredStabilizationModeGet(&stabDesired);
|
||||
if (stabDesired.Thrust == STABILIZATIONDESIRED_STABILIZATIONMODE_ALTITUDEHOLD ||
|
||||
stabDesired.Thrust == STABILIZATIONDESIRED_STABILIZATIONMODE_ALTITUDEVARIO) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user