1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Flight/ManualControl: Change to ManualControl module to make warning only kick in if input is less than the max and min for throttle. Disable going to (unimplemented) auto mode. Commiting based on one yay and no nay.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1505 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-09-02 16:33:02 +00:00 committed by peabody124
parent 25076d09a7
commit d3bb821e82

View File

@ -164,24 +164,20 @@ static void manualControlTask(void* parameters)
else
ManualControlCommandGet(&cmd); /* Under GCS control */
// Check for connection status (negative throttle values)
// The receiver failsafe for the throttle channel should be set to a value below the channel NEUTRAL
if ( cmd.Throttle < THROTTLE_FAILSAFE )
// Must check both Max and Min in case they reversed
if (cmd.Channel[settings.Throttle] < settings.ChannelMax[settings.Throttle] &&
cmd.Channel[settings.Throttle] < settings.ChannelMin[settings.Throttle])
{
cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_FALSE;
cmd.FlightMode = MANUALCONTROLCOMMAND_FLIGHTMODE_AUTO;
//cmd.FlightMode = MANUALCONTROLCOMMAND_FLIGHTMODE_AUTO; // don't do until AUTO implemented and functioning
AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_WARNING);
ManualControlCommandSet(&cmd);
ManualControlCommandSet(&cmd);
}
else
{
cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_TRUE;
AlarmsClear(SYSTEMALARMS_ALARM_MANUALCONTROL);
if ( cmd.Throttle < 0 )
{
cmd.Throttle = 0;
}
ManualControlCommandSet(&cmd);
ManualControlCommandSet(&cmd);
}
// Depending on the mode update the Stabilization or Actuator objects