|
|
|
@ -112,12 +112,12 @@ void Ekf::controlFusionModes()
@@ -112,12 +112,12 @@ void Ekf::controlFusionModes()
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
if (_control_status.flags.in_air) { |
|
|
|
|
// if transitioning from a non-3D 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) { |
|
|
|
|
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// always use 3D mag fusion when airborne
|
|
|
|
|
// use 3D mag fusion when airborne
|
|
|
|
|
_control_status.flags.mag_hdg = false; |
|
|
|
|
_control_status.flags.mag_2D = false; |
|
|
|
|
_control_status.flags.mag_3D = true; |
|
|
|
@ -143,7 +143,7 @@ void Ekf::controlFusionModes()
@@ -143,7 +143,7 @@ void Ekf::controlFusionModes()
|
|
|
|
|
_control_status.flags.mag_3D = false; |
|
|
|
|
|
|
|
|
|
} else if (_params.mag_fusion_type == MAG_FUSE_TYPE_3D) { |
|
|
|
|
// if transitioning from a non-3D 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) { |
|
|
|
|
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag); |
|
|
|
|
} |
|
|
|
|