Fix airspeed check in simulation

This commit is contained in:
Lorenz Meier 2016-02-18 22:53:43 +01:00
parent 4b6d0ef0a6
commit eb11c91733
1 changed files with 5 additions and 0 deletions

View File

@ -1228,7 +1228,12 @@ Sensors::diff_pres_poll(struct sensor_combined_s &raw)
/* push data into validator */
_airspeed_validator.put(_airspeed.timestamp, _diff_pres.differential_pressure_raw_pa, _diff_pres.error_count, 100);
#ifdef __PX4_POSIX
_airspeed.confidence = 1.0f;
#else
_airspeed.confidence = _airspeed_validator.confidence(hrt_absolute_time());
#endif
/* don't risk to feed negative airspeed into the system */
_airspeed.indicated_airspeed_m_s = math::max(0.0f,