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:
parent
e186101fe7
commit
f9f58f22d8
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user