Wind estimator: added wind_estimator_reset state (to indicate if wind estimator was reset in last fusion-cycle)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2019-07-09 13:50:21 +02:00
committed by Beat Küng
parent 09f29dbb07
commit a7d9c73d4d
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -88,6 +88,8 @@ WindEstimator::initialise(const matrix::Vector3f &velI, const matrix::Vector2f &
_time_rejected_tas = 0;
_time_rejected_beta = 0;
_wind_estimator_reset = true;
return true;
}
@@ -98,6 +100,9 @@ WindEstimator::update(uint64_t time_now)
return;
}
// set reset state to false (is set to true when initialise fuction is called later)
_wind_estimator_reset = false;
// run covariance prediction at 1Hz
if (time_now - _time_last_update < 1000 * 1000 || _time_last_update == 0) {
if (_time_last_update == 0) {
+3
View File
@@ -81,6 +81,7 @@ public:
wind_var[0] = _P(0, 0);
wind_var[1] = _P(1, 1);
}
bool get_wind_estimator_reset() { return _wind_estimator_reset; }
void set_wind_p_noise(float wind_sigma) { _wind_p_var = wind_sigma * wind_sigma; }
void set_tas_scale_p_noise(float tas_scale_sigma) { _tas_scale_p_var = tas_scale_sigma * tas_scale_sigma; }
@@ -123,6 +124,8 @@ private:
0; ///<timestamp of when true airspeed measurements have consistently started to be rejected
bool _scale_estimation_on = false; ///< online scale estimation (IAS-->CAS/EAS) is on
bool _wind_estimator_reset = false; ///< wind estimator was reset in this cycle
// initialise state and state covariance matrix
bool initialise(const matrix::Vector3f &velI, const matrix::Vector2f &velIvar, const float tas_meas);