1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +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
AltHoldSmoothedData altHold;
AltHoldSmoothedGet(&altHold);
altitudeHoldDesiredData.Velocity = 0;
altitudeHoldDesiredData.Altitude = altHold.Altitude;
zeroed = false;
} else if (cmd->Throttle > DEADBAND_HIGH && zeroed) {