mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: Fix bug in declination fusion
This commit is contained in:
parent
b4c1ecf9ce
commit
46b4c55fdc
|
@ -1006,7 +1006,7 @@ void NavEKF2_core::FuseDeclination(float declErr)
|
||||||
float magDecAng = use_compass() ? _ahrs->get_compass()->get_declination() : 0;
|
float magDecAng = use_compass() ? _ahrs->get_compass()->get_declination() : 0;
|
||||||
|
|
||||||
// Calculate the innovation
|
// Calculate the innovation
|
||||||
float innovation = atanf(t4) - magDecAng;
|
float innovation = atan2f(magE , magN) - magDecAng;
|
||||||
|
|
||||||
// limit the innovation to protect against data errors
|
// limit the innovation to protect against data errors
|
||||||
if (innovation > 0.5f) {
|
if (innovation > 0.5f) {
|
||||||
|
|
Loading…
Reference in New Issue