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

OP-1022 reset velocity when changing flight mode

This commit is contained in:
Alessio Morale 2013-07-17 08:37:56 +00:00
parent 7138faf167
commit 8c70e64544

View File

@ -860,6 +860,7 @@ static void altitudeHoldDesired(ManualControlCommandData *cmd, bool changed)
// After not being in this mode for a while init at current height // After not being in this mode for a while init at current height
AltHoldSmoothedData altHold; AltHoldSmoothedData altHold;
AltHoldSmoothedGet(&altHold); AltHoldSmoothedGet(&altHold);
altitudeHoldDesiredData.Velocity = 0;
altitudeHoldDesiredData.Altitude = altHold.Altitude; altitudeHoldDesiredData.Altitude = altHold.Altitude;
zeroed = false; zeroed = false;
} else if (cmd->Throttle > DEADBAND_HIGH && zeroed) { } else if (cmd->Throttle > DEADBAND_HIGH && zeroed) {