diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-26 23:12:28 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-26 23:12:28 +0200 |
commit | 9cc1f1ab9db4af9af18e6879ba82cbcfa8e588f3 (patch) | |
tree | 42ef2a1584d80f5c7d7b07fc8e02acd027096e14 /src | |
parent | 5e5322c593c6bd8ccd894f47ab8fd88b72e51677 (diff) | |
download | px4-firmware-9cc1f1ab9db4af9af18e6879ba82cbcfa8e588f3.tar.gz px4-firmware-9cc1f1ab9db4af9af18e6879ba82cbcfa8e588f3.tar.bz2 px4-firmware-9cc1f1ab9db4af9af18e6879ba82cbcfa8e588f3.zip |
flight termination on gps failure && datalink loss: do not activate in manual modes
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/commander.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 8b065560f..5673037b8 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1605,9 +1605,14 @@ int commander_thread_main(int argc, char *argv[]) /* Check for failure combinations which lead to flight termination */ if (armed.armed) { /* At this point the data link and the gps system have been checked - * If both failed we want to terminate the flight */ - if ((status.data_link_lost && status.gps_failure) || - (status.data_link_lost_cmd && status.gps_failure_cmd)) { + * If we are not in a manual (RC stick controlled mode) + * and both failed we want to terminate the flight */ + if (status.main_state != MAIN_STATE_MANUAL && + status.main_state != MAIN_STATE_ACRO && + status.main_state != MAIN_STATE_ALTCTL && + status.main_state != MAIN_STATE_POSCTL && + ((status.data_link_lost && status.gps_failure) || + (status.data_link_lost_cmd && status.gps_failure_cmd))) { armed.force_failsafe = true; status_changed = true; static bool flight_termination_printed = false; |