Browse Source

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>
master
Silvan Fuhrer 6 years ago committed by Beat Küng
parent
commit
a7d9c73d4d
  1. 5
      airdata/WindEstimator.cpp
  2. 3
      airdata/WindEstimator.hpp

5
airdata/WindEstimator.cpp

@ -88,6 +88,8 @@ WindEstimator::initialise(const matrix::Vector3f &velI, const matrix::Vector2f & @@ -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) @@ -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
airdata/WindEstimator.hpp

@ -81,6 +81,7 @@ public: @@ -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: @@ -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);

Loading…
Cancel
Save