EKF: Don't start using GPS for height until all validity checks have passed

Consolidate intermittent data checks, improve variable and clarify usage.
This commit is contained in:
Paul Riseborough
2019-06-13 19:36:37 +10:00
committed by Paul Riseborough
parent cef2ba5ab9
commit 7612fa40ed
3 changed files with 15 additions and 23 deletions
+2 -2
View File
@@ -59,8 +59,8 @@
bool Ekf::collect_gps(const gps_message &gps)
{
// Run GPS checks always
bool gps_checks_pass = gps_is_good(gps);
if (!_NED_origin_initialised && gps_checks_pass) {
_gps_checks_passed = gps_is_good(gps);
if (!_NED_origin_initialised && _gps_checks_passed) {
// If we have good GPS data set the origin's WGS-84 position to the last gps fix
double lat = gps.lat / 1.0e7;
double lon = gps.lon / 1.0e7;