1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Take the magnitude of the correct gravity vector

This commit is contained in:
Erik Gustavsson 2012-11-12 17:16:28 +01:00
parent e186101fe7
commit f9f58f22d8

View File

@ -488,7 +488,7 @@ static void updateAttitude(AccelsData * accelsData, GyrosData * gyrosData)
float grot_mag;
if (accel_filter_enabled)
grot_mag = sqrtf(grot[0]*grot[0] + grot[1]*grot[1] + grot[2]*grot[2]);
grot_mag = sqrtf(grot_filtered[0]*grot_filtered[0] + grot_filtered[1]*grot_filtered[1] + grot_filtered[2]*grot_filtered[2]);
else
grot_mag = 1.0f;