1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

CameraStab: bypass LPF calculation if ResponseTime is zero

This commit is contained in:
Oleg Semyonov 2011-12-18 02:24:15 +02:00
parent e11904c42f
commit 406cff296d

View File

@ -160,9 +160,14 @@ static void attitudeUpdated(UAVObjEvent* ev)
default:
PIOS_Assert(0);
}
// bypass LPF calculation if ResponseTime is zero
float rt = (float)cameraStab.ResponseTime[i];
csd->inputs_filtered[i] = (rt / (rt + csd->dT)) * csd->inputs_filtered[i]
+ (csd->dT / (rt + csd->dT)) * csd->inputs[i];
if (rt)
csd->inputs_filtered[i] = (rt / (rt + csd->dT)) * csd->inputs_filtered[i]
+ (csd->dT / (rt + csd->dT)) * csd->inputs[i];
else
csd->inputs_filtered[i] = csd->inputs[i];
}
}
}