aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_control
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-03-12 00:20:27 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-03-12 00:20:27 +0100
commita977ff2b6295bd4bac614a854ecc35e1b9b2d75c (patch)
treed2068daf35a09708e32865e649e5786f7be32728 /src/modules/fw_att_control
parent2f06f15240a9d03a282212538283e53e9bcc4b9f (diff)
downloadpx4-firmware-a977ff2b6295bd4bac614a854ecc35e1b9b2d75c.tar.gz
px4-firmware-a977ff2b6295bd4bac614a854ecc35e1b9b2d75c.tar.bz2
px4-firmware-a977ff2b6295bd4bac614a854ecc35e1b9b2d75c.zip
fw att control: add timestamp dependency in airspeed check
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r--src/modules/fw_att_control/fw_att_control_main.cpp3
1 files changed, 2 insertions, 1 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 deafd7f86..497d1d15a 100644
--- a/src/modules/fw_att_control/fw_att_control_main.cpp
+++ b/src/modules/fw_att_control/fw_att_control_main.cpp
@@ -632,7 +632,8 @@ FixedwingAttitudeControl::task_main()
/* 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)) {
+ !isfinite(_airspeed.indicated_airspeed_m_s) ||
+ (float)hrt_elapsed_time(&_airspeed.timestamp) > 1e6f) {
airspeed = _parameters.airspeed_trim;
} else {