From 5717434e93a6a3ab119c96a1f9da732b2b3adbd3 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 12 Mar 2022 12:51:54 -0500 Subject: [PATCH] ekf2: initialize GPS drift metrics to NAN rather than 0 --- src/modules/ekf2/EKF/estimator_interface.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/ekf2/EKF/estimator_interface.h b/src/modules/ekf2/EKF/estimator_interface.h index 579e4eea9d..c22065be75 100644 --- a/src/modules/ekf2/EKF/estimator_interface.h +++ b/src/modules/ekf2/EKF/estimator_interface.h @@ -344,9 +344,9 @@ protected: bool _deadreckon_time_exceeded{true}; // true if the horizontal nav solution has been deadreckoning for too long and is invalid - float _gps_horizontal_position_drift_rate_m_s{0}; // Horizontal position drift rate (m/s) - float _gps_vertical_position_drift_rate_m_s{0}; // Vertical position drift rate (m/s) - float _gps_filtered_horizontal_velocity_m_s{0}; // Filtered horizontal velocity (m/s) + float _gps_horizontal_position_drift_rate_m_s{NAN}; // Horizontal position drift rate (m/s) + float _gps_vertical_position_drift_rate_m_s{NAN}; // Vertical position drift rate (m/s) + float _gps_filtered_horizontal_velocity_m_s{NAN}; // Filtered horizontal velocity (m/s) uint64_t _time_last_on_ground_us{0}; ///< last time we were on the ground (uSec) uint64_t _time_last_in_air{0}; ///< last time we were in air (uSec)