mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-04 02:08:52 +08:00
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:
@@ -88,6 +88,8 @@ WindEstimator::initialise(const matrix::Vector3f &velI, const matrix::Vector2f &
|
|||||||
_time_rejected_tas = 0;
|
_time_rejected_tas = 0;
|
||||||
_time_rejected_beta = 0;
|
_time_rejected_beta = 0;
|
||||||
|
|
||||||
|
_wind_estimator_reset = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +100,9 @@ WindEstimator::update(uint64_t time_now)
|
|||||||
return;
|
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
|
// run covariance prediction at 1Hz
|
||||||
if (time_now - _time_last_update < 1000 * 1000 || _time_last_update == 0) {
|
if (time_now - _time_last_update < 1000 * 1000 || _time_last_update == 0) {
|
||||||
if (_time_last_update == 0) {
|
if (_time_last_update == 0) {
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public:
|
|||||||
wind_var[0] = _P(0, 0);
|
wind_var[0] = _P(0, 0);
|
||||||
wind_var[1] = _P(1, 1);
|
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_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; }
|
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
|
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 _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
|
// initialise state and state covariance matrix
|
||||||
bool initialise(const matrix::Vector3f &velI, const matrix::Vector2f &velIvar, const float tas_meas);
|
bool initialise(const matrix::Vector3f &velI, const matrix::Vector2f &velIvar, const float tas_meas);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user