fixing mag heading. DO NOT FLY!
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@399 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
44a671136b
commit
05ced4c784
|
@ -319,7 +319,7 @@ static void getEstimatedAttitude(void)
|
|||
float Xh = magX * cp + magY * sr * sp + magZ * cr * sp;
|
||||
float Yh = magY * cr - magZ * sr;
|
||||
float hd = (atan2f(-Yh, Xh) * 1800.0f / M_PI + magneticDeclination) / 10.0f;
|
||||
heading = hd;
|
||||
heading = -hd;
|
||||
if (heading > 180)
|
||||
heading = heading - 360;
|
||||
else if (heading < -180)
|
||||
|
|
Loading…
Reference in New Issue