diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-14 14:36:52 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-14 14:36:52 +0100 |
commit | f337d62f2da3c4765acc8b88a4cef3381a89c6e7 (patch) | |
tree | e65cc28819a520af48ee17443c7d995aaeeded4a /src/modules/fw_att_control | |
parent | 4ba80eb3c98035ea5304bfd1eb068ecdbd734bd8 (diff) | |
download | px4-firmware-f337d62f2da3c4765acc8b88a4cef3381a89c6e7.tar.gz px4-firmware-f337d62f2da3c4765acc8b88a4cef3381a89c6e7.tar.bz2 px4-firmware-f337d62f2da3c4765acc8b88a4cef3381a89c6e7.zip |
fw attitude: fix handling of invalid airspeed
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r-- | src/modules/fw_att_control/fw_att_control_main.cpp | 4 |
1 files changed, 2 insertions, 2 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 53f89c7c4..ff3f13306 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -635,9 +635,9 @@ FixedwingAttitudeControl::task_main() /* if airspeed is smaller than min, the sensor is not giving good readings */ if (!_airspeed_valid || - (_airspeed.indicated_airspeed_m_s < _parameters.airspeed_min) || + (_airspeed.indicated_airspeed_m_s < 0.1f * _parameters.airspeed_min) || !isfinite(_airspeed.indicated_airspeed_m_s)) { - airspeed = _parameters.airspeed_min + (_parameters.airspeed_max - _parameters.airspeed_min) / 2.0f; + airspeed = _parameters.airspeed_trim; } else { airspeed = _airspeed.indicated_airspeed_m_s; |