1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Fix to acc gyro accumulation code

This commit is contained in:
Martin Budden 2017-11-28 15:10:11 +00:00
parent 94d3549299
commit c0b1572175
3 changed files with 29 additions and 30 deletions

View file

@ -449,7 +449,9 @@ static void imuCalculateEstimatedAttitude(timeUs_t currentTimeUs)
float gyroAverage[XYZ_AXIS_COUNT];
gyroGetAccumulationAverage(gyroAverage);
float accAverage[XYZ_AXIS_COUNT];
accGetAccumulationAverage(accAverage);
if (!accGetAccumulationAverage(accAverage)) {
useAcc = false;
}
imuMahonyAHRSupdate(deltaT * 1e-6f,
DEGREES_TO_RADIANS(gyroAverage[X]), DEGREES_TO_RADIANS(gyroAverage[Y]), DEGREES_TO_RADIANS(gyroAverage[Z]),
useAcc, accAverage[X], accAverage[Y], accAverage[Z],