mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 00:43:33 +08:00
EKF: Add simple control logic for magnetic declination constraint
This commit is contained in:
@@ -109,6 +109,13 @@ void Ekf::controlFusionModes()
|
|||||||
_control_status.flags.mag_3D = false;
|
_control_status.flags.mag_3D = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we are using 3-axis magnetometer fusion, but without external aiding, then the declination needs to be fused as an observation to prevent long term heading drift
|
||||||
|
if(_control_status.flags.mag_3D && _control_status.flags.gps) {
|
||||||
|
_control_status.flags.mag_dec = false;
|
||||||
|
} else {
|
||||||
|
_control_status.flags.mag_dec = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ekf::calculateVehicleStatus()
|
void Ekf::calculateVehicleStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user