mag_control: fuse fake heading during leveling fine alignment (#17964)

Co-authored-by: Daniel Agar <daniel@agar.ca>
This commit is contained in:
Mathieu Bresciani
2021-07-27 11:50:50 +02:00
committed by GitHub
co-authored by Daniel Agar
parent f2ae8ae814
commit 17ebcd2456
5 changed files with 765 additions and 755 deletions
+10
View File
@@ -781,6 +781,11 @@ void Ekf::fuseHeading()
// Vehicle is at rest so use the last moving prediction as an observation
// to prevent the heading from drifting and to enable yaw gyro bias learning
// before takeoff.
if (!PX4_ISFINITE(_last_static_yaw)) {
_last_static_yaw = predicted_hdg;
}
measured_hdg = _last_static_yaw;
}
@@ -836,6 +841,11 @@ void Ekf::fuseHeading()
// Vehicle is at rest so use the last moving prediction as an observation
// to prevent the heading from drifting and to enable yaw gyro bias learning
// before takeoff.
if (!PX4_ISFINITE(_last_static_yaw)) {
_last_static_yaw = predicted_hdg;
}
measured_hdg = _last_static_yaw;
}