68 float lpos_vx,
float lpos_vy,
69 float lpos_vz,
float lpos_evh,
float lpos_evv,
const float att_q[4])
71 bool att_valid =
true;
77 Vector3f vI(lpos_vx, lpos_vy, lpos_vz);
140 float estimator_status_mag_test_ratio)
176 if ((estimator_status_vel_test_ratio < 1.0
f) && (estimator_status_mag_test_ratio < 1.0f)) {
202 const bool bad_number_fail =
false;
206 if (!bad_number_fail) {
208 max_lift_ratio *= max_lift_ratio;
230 const bool bad_number_fail =
false;
259 if (
_data_stopped_failed || both_checks_failed || single_check_fail_timeout || bad_number_fail) {
float _tas_innov_threshold
innovation error threshold for triggering innovation check failure
uint64_t _time_last_airspeed
time last airspeed measurement was received (uSec)
float _tas_gate
gate size of airspeed innovation (to calculate tas_test_ratio)
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
float _load_factor_ratio
ratio of maximum load factor predicted by stall speed to measured load factor
void check_load_factor(float accel_z)
void update(uint64_t time_now)
uint64_t _time_checks_failed
time the checks have last not passed (uSec)
float calc_TAS_from_EAS(float speed_equivalent, float pressure_ambient, float temperature_celsius)
Calculate true airspeed (TAS) from equivalent airspeed (EAS).
void update_airspeed_valid_status(const uint64_t timestamp)
int _checks_fail_delay
delay for airspeed invalid declaration after single check failure (Sec)
void get_wind(float wind[2])
bool _airspeed_valid
airspeed valid (pitot or groundspeed-windspeed)
uint64_t _time_last_aspd_innov_check
time airspeed innovation was last checked (uSec)
void check_airspeed_innovation(uint64_t timestamp, float estimator_status_vel_test_ratio, float estimator_status_mag_test_ratio)
void update_wind_estimator(const uint64_t timestamp, float airspeed_true_raw, bool lpos_valid, float lpos_vx, float lpos_vy, float lpos_vz, float lpos_evh, float lpos_evv, const float att_q[4])
static constexpr uint64_t TAS_INNOV_FAIL_DELAY
time required for innovation levels to pass or fail (usec)
WindEstimator _wind_estimator
wind estimator instance running in this particular airspeedValidator
float _EAS
equivalent airspeed in m/s
void get_wind_var(float wind_var[2])
float get_beta_innov_var()
void fuse_beta(uint64_t time_now, const matrix::Vector3f &velI, const matrix::Quatf &q_att)
float _tas_innov_integ_threshold
integrator innovation error threshold for triggering innovation check failure
Calculates airspeed from differential pressure and checks if this airspeed is valid.
bool _in_fixed_wing_flight
variable to bypass innovation and load factor checks
bool _airspeed_failing
airspeed sensor checks have detected failure, but not yet declared failed
wind_estimate_s get_wind_estimator_states(uint64_t timestamp)
float _IAS
indicated airsped in m/s
float _airspeed_scale_manual
manually entered airspeed scale
void update_airspeed_validator(const airspeed_validator_update_data &input_data)
bool _data_stopped_failed
data_stopp check has detected failure
void update_in_fixed_wing_flight(bool in_fixed_wing_flight)
uint64_t _time_last_tas_fail
last time innovation checks failed
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
Vector2< float > Vector2f
uint64_t airspeed_timestamp
void set_airspeed_scale_manual(float airspeed_scale_manual)
float _airspeed_stall
stall speed of aircraft used for load factor check
void update_EAS_TAS(float air_pressure_pa, float air_temperature_celsius)
int _checks_clear_delay
delay for airspeed valid declaration after all checks passed again (Sec)
float _apsd_innov_integ_state
inegral of excess normalised airspeed innovation (sec)
bool _load_factor_check_failed
load_factor check has detected failure
float airspeed_indicated_raw
void fuse_airspeed(uint64_t time_now, float true_airspeed, const matrix::Vector3f &velI, const matrix::Vector2f &velIvar)
Vector3< float > Vector3f
bool _innovations_check_failed
true when airspeed innovations have failed consistency checks
constexpr _Tp max(_Tp a, _Tp b)
float _TAS
true airspeed in m/s
Quaternion< float > Quatf
void enforce_airspeed_scale(float scale)
hrt_abstime _previous_airspeed_timestamp
timestamp from previous measurement input, to check validity of measurement
float _EAS_scale
scale factor from IAS to EAS
uint64_t _time_wind_estimator_initialized
time last time wind estimator was initialized (uSec)
float calc_EAS_from_IAS(float speed_indicated, float scale)
Calculate equivalent airspeed (EAS) from indicated airspeed (IAS).
bool in_fixed_wing_flight
float air_temperature_celsius
float get_tas_innov_var()
uint64_t _time_last_tas_pass
last time innovation checks passed
bool get_wind_estimator_reset()
uint64_t _time_checks_passed
time the checks have last passed (uSec)