1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

[INAV] Initial cut on ignoring acceleromer in estimation when clipping

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2019-05-04 22:09:28 +02:00 committed by Konstantin Sharlaimov
parent 43630a0230
commit 7598f222e7
4 changed files with 47 additions and 8 deletions

View file

@ -541,8 +541,12 @@ void accUpdate(void)
// Before filtering check for clipping and vibration levels
if (fabsf(acc.accADCf[X]) > ACC_CLIPPING_THRESHOLD_G || fabsf(acc.accADCf[Y]) > ACC_CLIPPING_THRESHOLD_G || fabsf(acc.accADCf[Z]) > ACC_CLIPPING_THRESHOLD_G) {
acc.isClipped = true;
acc.accClipCount++;
}
else {
acc.isClipped = false;
}
// Calculate vibration levels
for (int axis = 0; axis < XYZ_AXIS_COUNT; axis++) {
@ -587,6 +591,11 @@ uint32_t accGetClipCount(void)
return acc.accClipCount;
}
bool accIsClipped(void)
{
return acc.isClipped;
}
void accSetCalibrationValues(void)
{
if ((accelerometerConfig()->accZero.raw[X] == 0) && (accelerometerConfig()->accZero.raw[Y] == 0) && (accelerometerConfig()->accZero.raw[Z] == 0) &&