From cc50d26601cb58aa5c1c1f84d657f052db2a9ab1 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 28 Jan 2016 08:11:10 +1100 Subject: [PATCH] EKF: Update comments --- EKF/estimator_base.h | 7 ++++--- EKF/gps_checks.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/EKF/estimator_base.h b/EKF/estimator_base.h index 793eced7aa..b7b0a96453 100644 --- a/EKF/estimator_base.h +++ b/EKF/estimator_base.h @@ -337,9 +337,10 @@ public: *time_us = _imu_time_last; } - uint64_t _last_gps_origin_time_us = 0; - struct map_projection_reference_s _posRef = {}; - float _gps_alt_ref = 0.0f; + // Variables used to publish the WGS-84 location of the EKF local NED origin + uint64_t _last_gps_origin_time_us = 0; // time the origin was last set (uSec) + struct map_projection_reference_s _posRef = {}; // Contains WGS-84 position latitude and longitude (radians) + float _gps_alt_ref = 0.0f; // WGS-84 height (m) bool _vehicleArmed = false; // vehicle arm status used to turn off funtionality used on the ground diff --git a/EKF/gps_checks.cpp b/EKF/gps_checks.cpp index 1464ed6f35..533ebc2e1e 100644 --- a/EKF/gps_checks.cpp +++ b/EKF/gps_checks.cpp @@ -88,7 +88,7 @@ bool EstimatorBase::gps_is_good(struct gps_message *gps) _gps_alt_ref = gps->alt * 1e-3f; } - // Calculate time lapsesd since last update, limit to prevent numerical errors and calculate the lowpass filter coefficient + // Calculate time lapsed since last update, limit to prevent numerical errors and calculate the lowpass filter coefficient const float filtTimeConst = 10.0f; float dt = fminf(fmaxf(float(_time_last_imu - _last_gps_origin_time_us)*1e-6f,0.001f),filtTimeConst); float filterCoef = dt/filtTimeConst;