1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-289/Flight: do not use RC input if disconnected. Quick fix until better arming system is designed.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2479 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
osnwt 2011-01-19 00:01:33 +00:00 committed by osnwt
parent 76420d7972
commit 780f441ae9

View File

@ -316,7 +316,7 @@ static void manualControlTask(void *parameters)
// Look for state changes and write in newArmState
if (settings.Arming == MANUALCONTROLSETTINGS_ARMING_NONE) {
// No cahnnel assigned to arming -> arm imeediately when throttle is low
// No channel assigned to arming -> arm immediately when throttle is low
newCmdArmed = MANUALCONTROLCOMMAND_ARMED_TRUE;
} else {
float armStickLevel;
@ -325,15 +325,18 @@ static void manualControlTask(void *parameters)
bool manualArm = false;
bool manualDisarm = false;
armStickLevel = scaleChannel(cmd.Channel[channel], settings.ChannelMax[channel],
settings.ChannelMin[channel], settings.ChannelNeutral[channel]);
if (reverse)
armStickLevel =-armStickLevel;
if (connection_state == CONNECTED) {
// Should use RC input only if RX is connected
armStickLevel = scaleChannel(cmd.Channel[channel], settings.ChannelMax[channel],
settings.ChannelMin[channel], settings.ChannelNeutral[channel]);
if (reverse)
armStickLevel =-armStickLevel;
if (armStickLevel <= -0.90)
manualArm = true;
else if (armStickLevel >= +0.90)
manualDisarm = true;
if (armStickLevel <= -0.90)
manualArm = true;
else if (armStickLevel >= +0.90)
manualDisarm = true;
}
switch(armState) {
case ARM_STATE_DISARMED: