From 59889000443487667b379c5e07f78705ab163a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20D=C3=BCrr?= Date: Fri, 11 Aug 2017 17:25:05 +0200 Subject: [PATCH] Add getters for a few private variables of the EstimatorInterface * For testing it is useful to have access to more internal states * For the same reason I also promote the const FILTER_UPDATE_PERIOD_MS to public --- EKF/estimator_interface.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index 534c9f62c0..b0dc5501e7 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -298,6 +298,32 @@ public: // 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; + // Getter for the average imu update period in s + float get_dt_imu_avg() + { + return _dt_imu_avg; + } + + // Getter for the imu sample on the delayed time horizon + imuSample get_imu_sample_delayed() + { + return _imu_sample_delayed; + } + + // Getter for the baro sample on the delayed time horizon + baroSample get_baro_sample_delayed() + { + return _baro_sample_delayed; + } + + // Getter for a flag indicating if the ekf should update (completed downsampling process) + bool get_imu_updated() + { + return _imu_updated; + } + + static const unsigned FILTER_UPDATE_PERIOD_MS = 12; // ekf prediction period in milliseconds - this should ideally be an integer multiple of the IMU time delta + protected: parameters _params; // filter parameters @@ -318,7 +344,6 @@ protected: This can be adjusted to a value that is FILTER_UPDATE_PERIOD_MS longer than the maximum observation time delay. */ uint8_t _imu_buffer_length{0}; - static const unsigned FILTER_UPDATE_PERIOD_MS = 12; // ekf prediction period in milliseconds - this should ideally be an integer multiple of the IMU time delta unsigned _min_obs_interval_us{0}; // minimum time interval between observations that will guarantee data is not lost (usec)