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:
parent
94d3549299
commit
c0b1572175
3 changed files with 29 additions and 30 deletions
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue