aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander/state_machine_helper.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-09-07 15:33:11 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-09-22 10:54:27 +0200
commite17411769847f8681dc05da72ed4a06ff27a7a32 (patch)
treebf5e938f532f3d72b0884bcaef7f9493d8c53e72 /src/modules/commander/state_machine_helper.cpp
parent1fb8e76f0a4508cadd63b47e6f94a6638b699bcc (diff)
downloadpx4-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/commander/state_machine_helper.cpp')
-rw-r--r--src/modules/commander/state_machine_helper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp
index e3b5d30e4..9568752ae 100644
--- a/src/modules/commander/state_machine_helper.cpp
+++ b/src/modules/commander/state_machine_helper.cpp
@@ -511,10 +511,10 @@ bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_en
} else if (status->rc_signal_lost_cmd) {
status->nav_state = NAVIGATION_STATE_AUTO_RTGS; //XXX
/* Finished handling commands which have priority , now handle failures */
- } else if (status->engine_failure) {
- status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL;
} else if (status->gps_failure) {
status->nav_state = NAVIGATION_STATE_AUTO_LANDGPSFAIL;
+ } else if (status->engine_failure) {
+ status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL;
} else if (((status->data_link_lost && data_link_loss_enabled) && status->rc_signal_lost) ||
(!data_link_loss_enabled && status->rc_signal_lost && mission_finished)) {
status->failsafe = true;