mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 15:53:34 +08:00
EKF: Don't use 3-axis magnetometer fusion until the tilt is aligned
This commit is contained in:
+1
-1
@@ -481,7 +481,7 @@ void Ekf::controlMagAiding()
|
|||||||
// or the more accurate 3-axis fusion
|
// or the more accurate 3-axis fusion
|
||||||
if (_params.mag_fusion_type == MAG_FUSE_TYPE_AUTO) {
|
if (_params.mag_fusion_type == MAG_FUSE_TYPE_AUTO) {
|
||||||
|
|
||||||
if (_control_status.flags.in_air) {
|
if (_control_status.flags.in_air && _control_status.flags.tilt_align) {
|
||||||
// if transitioning into 3-axis fusion mode, we need to initialise the yaw angle and field states
|
// if transitioning into 3-axis fusion mode, we need to initialise the yaw angle and field states
|
||||||
if (!_control_status.flags.mag_3D) {
|
if (!_control_status.flags.mag_3D) {
|
||||||
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
||||||
|
|||||||
Reference in New Issue
Block a user