diff --git a/EKF/ekf.h b/EKF/ekf.h index 5fca7e4c65..cdfd72d6c1 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -123,6 +123,9 @@ public: void get_accel_bias(float *bias) {*bias = _state.accel_z_bias;} + // get GPS check status + void get_gps_check_status(uint16_t *_gps_check_fail_status); + private: static const uint8_t _k_num_states = 24; diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 929b3b2429..bf9c9edfdd 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -316,6 +316,12 @@ void Ekf::get_heading_innov_var(float *heading_innov_var) memcpy(heading_innov_var, &_heading_innov_var, sizeof(float)); } +// get GPS check status +void Ekf::get_gps_check_status(uint16_t *val) +{ + memcpy(val, &_gps_check_fail_status, sizeof(uint16_t)); +} + // get the state vector at the delayed time horizon void Ekf::get_state_delayed(float *state) { diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index 11119e39a2..ed8cf5a9a3 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -217,6 +217,9 @@ public: *val = _control_status.value; } + // get GPS check status + virtual void get_gps_check_status(uint16_t *val) = 0; + protected: parameters _params; // filter parameters