1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Update pid.c

To solve the problem where the quad is stuck in crashrecoverymode because he is stuck on the floor :)
This commit is contained in:
Vidalcris 2017-07-23 13:49:37 +02:00 committed by GitHub
parent 8ccb5097df
commit 4546372dac

View file

@ -450,7 +450,7 @@ void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *an
previousRateError[axis] = rD;
// if crash recovery is on and accelerometer enabled then check for a crash
if (pidProfile->crash_recovery && sensors(SENSOR_ACC)) {
if (pidProfile->crash_recovery && sensors(SENSOR_ACC) && inCrashRecoveryMode ==false) {
if (motorMixRange >= 1.0f
&& ABS(delta) > crashDtermThreshold
&& ABS(errorRate) > crashGyroThreshold