diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-05 21:06:21 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-04-05 21:06:21 +0200 |
commit | 4a0c6600887e900932f6888f1b8948816a1f00b4 (patch) | |
tree | d034497b89398d40766d06b4ce37ced3459331ed /src/modules/fw_att_control | |
parent | be6c0d2ece235077f067f4db10689b8ad3d9c5b1 (diff) | |
download | px4-firmware-4a0c6600887e900932f6888f1b8948816a1f00b4.tar.gz px4-firmware-4a0c6600887e900932f6888f1b8948816a1f00b4.tar.bz2 px4-firmware-4a0c6600887e900932f6888f1b8948816a1f00b4.zip |
Do not make minimum airspeed assumptions, as we can trust our digital sensor a bit. A blocked pitot also most likely will result in more than just 6.5 m/s airspeed and so the check is based on a bunch of weak assumptions
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r-- | src/modules/fw_att_control/fw_att_control_main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index f139c25f4..522e8c3e6 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -660,14 +660,13 @@ FixedwingAttitudeControl::task_main() float airspeed; - /* if airspeed is smaller than min, the sensor is not giving good readings */ - if ((_airspeed.indicated_airspeed_m_s < 0.5f * _parameters.airspeed_min) || - !isfinite(_airspeed.indicated_airspeed_m_s) || + /* if airspeed is not updating, we assume the normal average speed */ + if (!isfinite(_airspeed.true_airspeed_m_s) || hrt_elapsed_time(&_airspeed.timestamp) > 1e6) { airspeed = _parameters.airspeed_trim; } else { - airspeed = _airspeed.indicated_airspeed_m_s; + airspeed = _airspeed.true_airspeed_m_s; } float airspeed_scaling = _parameters.airspeed_trim / airspeed; |