aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-08-26 23:12:28 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-08-26 23:12:28 +0200
commit9cc1f1ab9db4af9af18e6879ba82cbcfa8e588f3 (patch)
tree42ef2a1584d80f5c7d7b07fc8e02acd027096e14 /src/modules
parent5e5322c593c6bd8ccd894f47ab8fd88b72e51677 (diff)
downloadpx4-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/modules')
-rw-r--r--src/modules/commander/commander.cpp11
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;