mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 14:51:37 +08:00
ekf2: fuse mag update last heading fuse time if updating all states
- handle synthetic z special case
This commit is contained in:
@@ -167,6 +167,7 @@ bool Ekf::fuseMag(const Vector3f &mag, estimator_aid_source3d_s &aid_src_mag, bo
|
|||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
// we do not fuse synthesized magnetomter measurements when doing 3D fusion
|
// we do not fuse synthesized magnetomter measurements when doing 3D fusion
|
||||||
if (_control_status.flags.synthetic_mag_z) {
|
if (_control_status.flags.synthetic_mag_z) {
|
||||||
|
fused[2] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,6 +217,11 @@ bool Ekf::fuseMag(const Vector3f &mag, estimator_aid_source3d_s &aid_src_mag, bo
|
|||||||
if (fused[0] && fused[1] && fused[2]) {
|
if (fused[0] && fused[1] && fused[2]) {
|
||||||
aid_src_mag.fused = true;
|
aid_src_mag.fused = true;
|
||||||
aid_src_mag.time_last_fuse = _time_delayed_us;
|
aid_src_mag.time_last_fuse = _time_delayed_us;
|
||||||
|
|
||||||
|
if (update_all_states) {
|
||||||
|
_time_last_heading_fuse = _time_delayed_us;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user