mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 19:19:06 +08:00
EKF: Always reset yaw and mag field states on entry into 3-axis mag fusion mode
This commit is contained in:
parent
2d09a5f3ac
commit
5b5bddebea
@ -112,6 +112,11 @@ 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 (!_control_status.flags.mag_3D) {
|
||||
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
||||
}
|
||||
|
||||
// always use 3D mag fusion when airborne
|
||||
_control_status.flags.mag_hdg = false;
|
||||
_control_status.flags.mag_2D = false;
|
||||
@ -145,6 +150,11 @@ 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 (!_control_status.flags.mag_3D) {
|
||||
_control_status.flags.yaw_align = resetMagHeading(_mag_sample_delayed.mag);
|
||||
}
|
||||
|
||||
// always use 3-axis mag fusion
|
||||
_control_status.flags.mag_hdg = false;
|
||||
_control_status.flags.mag_2D = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user