From 5c8b22b43fabd42766031ecaac9130531a85e367 Mon Sep 17 00:00:00 2001 From: CarlOlsson Date: Mon, 18 Dec 2017 15:36:28 +0100 Subject: [PATCH] ekf: return beta test ratio in get_innovation_test_status Signed-off-by: CarlOlsson --- EKF/ekf.h | 2 +- EKF/ekf_helper.cpp | 4 +++- EKF/estimator_interface.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/EKF/ekf.h b/EKF/ekf.h index f086e06f1e..f5304deba6 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -224,7 +224,7 @@ public: // Innovation Test Ratios - these are the ratio of the innovation to the acceptance threshold. // A value > 1 indicates that the sensor measurement has exceeded the maximum acceptable level and has been rejected by the EKF // Where a measurement type is a vector quantity, eg magnetoemter, GPS position, etc, the maximum value is returned. - void get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl); + void get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl, float *beta); // return a bitmask integer that describes which state estimates can be used for flight control void get_ekf_soln_status(uint16_t *status); diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 07c4d07f7c..d15ca376b5 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -1100,7 +1100,7 @@ bool Ekf::reset_imu_bias() // Innovation Test Ratios - these are the ratio of the innovation to the acceptance threshold. // A value > 1 indicates that the sensor measurement has exceeded the maximum acceptable level and has been rejected by the EKF // Where a measurement type is a vector quantity, eg magnetoemter, GPS position, etc, the maximum value is returned. -void Ekf::get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl) +void Ekf::get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl, float *beta) { // return the integer bitmask containing the consistency check pass/fail satus *status = _innov_check_fail_status.value; @@ -1116,6 +1116,8 @@ void Ekf::get_innovation_test_status(uint16_t *status, float *mag, float *vel, f *tas = sqrtf(_tas_test_ratio); // return the terrain height innovation test ratio *hagl = sqrtf(_terr_test_ratio); + // return the synthetic sideslip innovation test ratio + *beta = sqrtf(_beta_test_ratio); } // return a bitmask integer that describes which state estimates are valid diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index 59872cbd84..06c9a7dfd5 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -338,7 +338,7 @@ public: // Innovation Test Ratios - these are the ratio of the innovation to the acceptance threshold. // A value > 1 indicates that the sensor measurement has exceeded the maximum acceptable level and has been rejected by the EKF // Where a measurement type is a vector quantity, eg magnetoemter, GPS position, etc, the maximum value is returned. - virtual void get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl) = 0; + virtual void get_innovation_test_status(uint16_t *status, float *mag, float *vel, float *pos, float *hgt, float *tas, float *hagl, float *beta) = 0; // return a bitmask integer that describes which state estimates can be used for flight control virtual void get_ekf_soln_status(uint16_t *status) = 0;