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
This commit is contained in:
Peter Dürr 2017-08-11 17:25:05 +02:00 committed by Lorenz Meier
parent a2ed0a76f9
commit 5988900044
1 changed files with 26 additions and 1 deletions

View File

@ -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)