mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Flight/Actuator: Add failsafe for when flying via GCS to disarm at
lost connection git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2067 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
d72f60274d
commit
c69c4157f1
@ -36,6 +36,7 @@
|
||||
//#include "vtolsettings.h"
|
||||
#include "systemsettings.h"
|
||||
#include "actuatordesired.h"
|
||||
#include "flighttelemetrystats.h"
|
||||
#include "actuatorcommand.h"
|
||||
#include "manualcontrolcommand.h"
|
||||
#include "mixersettings.h"
|
||||
@ -179,6 +180,14 @@ static void actuatorTask(void* parameters)
|
||||
AlarmsClear(SYSTEMALARMS_ALARM_ACTUATOR);
|
||||
|
||||
bool armed = manualControl.Armed == MANUALCONTROLCOMMAND_ARMED_TRUE;
|
||||
if(ManualControlCommandReadOnly(&manualControl)) {
|
||||
/* when being controlled by GCS check for connection still intact */
|
||||
/* eventually this lost connection (like lost RX) will trigger */
|
||||
/* a failsafe flight pattern */
|
||||
FlightTelemetryStatsData flightStats;
|
||||
FlightTelemetryStatsGet(&flightStats);
|
||||
armed &= (flightStats.Status == FLIGHTTELEMETRYSTATS_STATUS_CONNECTED);
|
||||
}
|
||||
armed &= desired.Throttle > 0.05; //zero throttle stops the motors
|
||||
|
||||
float curve1 = MixerCurve(desired.Throttle,mixerSettings.ThrottleCurve1);
|
||||
|
Loading…
Reference in New Issue
Block a user