mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
Actuator: Fixed motors not going to min throttle in failsafe.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1884 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
141f6e43fb
commit
b2c81aceee
@ -357,10 +357,22 @@ static void setFailsafe()
|
||||
|
||||
ActuatorCommandGet(&command);
|
||||
ActuatorSettingsGet(&settings);
|
||||
// Reset ActuatorCommand to neutral values
|
||||
|
||||
MixerSettingsData mixerSettings;
|
||||
MixerSettingsGet (&mixerSettings);
|
||||
Mixer_t * mixers = (Mixer_t *)&mixerSettings.Mixer0Type; //pointer to array of mixers in UAVObjects
|
||||
|
||||
// Reset ActuatorCommand to safe values
|
||||
for (int n = 0; n < ACTUATORCOMMAND_CHANNEL_NUMELEM; ++n)
|
||||
{
|
||||
command.Channel[n] = settings.ChannelNeutral[n];
|
||||
if(mixers[n].type == MIXERSETTINGS_MIXER0TYPE_MOTOR)
|
||||
{
|
||||
command.Channel[n] = settings.ChannelMin[n];
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Channel[n] = settings.ChannelNeutral[n];
|
||||
}
|
||||
}
|
||||
|
||||
// Set alarm
|
||||
|
Loading…
Reference in New Issue
Block a user