diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-07 15:33:11 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-22 10:54:27 +0200 |
commit | e17411769847f8681dc05da72ed4a06ff27a7a32 (patch) | |
tree | bf5e938f532f3d72b0884bcaef7f9493d8c53e72 /src/modules/fw_att_control | |
parent | 1fb8e76f0a4508cadd63b47e6f94a6638b699bcc (diff) | |
download | px4-firmware-e17411769847f8681dc05da72ed4a06ff27a7a32.tar.gz px4-firmware-e17411769847f8681dc05da72ed4a06ff27a7a32.tar.bz2 px4-firmware-e17411769847f8681dc05da72ed4a06ff27a7a32.zip |
gps failure has priority over engine falure, in case both fail make sure
that the gps failure mode does not turn on the engine
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r-- | src/modules/fw_att_control/fw_att_control_main.cpp | 8 |
1 files changed, 6 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 517333c80..7cf721a35 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -860,8 +860,12 @@ FixedwingAttitudeControl::task_main() } } - /* throttle passed through */ - _actuators.control[3] = (isfinite(throttle_sp)) ? throttle_sp : 0.0f; + /* throttle passed through if it is finite and if no engine failure was + * detected */ + _actuators.control[3] = (isfinite(throttle_sp) && + !(_vehicle_status.engine_failure || + _vehicle_status.engine_failure_cmd)) ? + throttle_sp : 0.0f; if (!isfinite(throttle_sp)) { if (_debug && loop_counter % 10 == 0) { warnx("throttle_sp %.4f", (double)throttle_sp); |