diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 02:10:53 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-07 02:10:53 -0700 |
commit | 8dd0453edc108f86b16f00e6164d71ef516b474f (patch) | |
tree | be2caeea00423bdf601be7ff2557c911f6593c72 /src/modules/commander | |
parent | 3f57aea8e045fb8284a1644d6a79ff41d3f8723c (diff) | |
parent | 32b84b9652b5636ba4a2a30caae6fffacb47f1d0 (diff) | |
download | px4-firmware-8dd0453edc108f86b16f00e6164d71ef516b474f.tar.gz px4-firmware-8dd0453edc108f86b16f00e6164d71ef516b474f.tar.bz2 px4-firmware-8dd0453edc108f86b16f00e6164d71ef516b474f.zip |
Merge pull request #909 from PX4/failsafe_reporting
Much better failsafe reporting on failsafe state changes
Diffstat (limited to 'src/modules/commander')
-rw-r--r-- | src/modules/commander/commander.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index aa4e643dc..dfab9d4d6 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1285,6 +1285,13 @@ int commander_thread_main(int argc, char *argv[]) if (res == TRANSITION_DENIED) { /* LAND not allowed, set TERMINATION state */ transition_result_t res = failsafe_state_transition(&status, FAILSAFE_STATE_TERMINATION); + + if (res == TRANSITION_CHANGED) { + mavlink_log_critical(mavlink_fd, "#a FAILSAFE: TERMINATION"); + } + + } else if (res == TRANSITION_CHANGED) { + mavlink_log_critical(mavlink_fd, "#a FAILSAFE: LANDING"); } } @@ -1295,15 +1302,25 @@ int commander_thread_main(int argc, char *argv[]) if (!status.condition_landed) { /* vehicle is not landed, try to perform RTL */ res = failsafe_state_transition(&status, FAILSAFE_STATE_RTL); + + if (res == TRANSITION_CHANGED) { + mavlink_log_critical(mavlink_fd, "#a FAILSAFE: RETURN TO LAND"); + } } if (res == TRANSITION_DENIED) { /* RTL not allowed (no global position estimate) or not wanted, try LAND */ res = failsafe_state_transition(&status, FAILSAFE_STATE_LAND); + if (res == TRANSITION_CHANGED) { + mavlink_log_critical(mavlink_fd, "#a FAILSAFE: LANDING"); + } + if (res == TRANSITION_DENIED) { /* LAND not allowed, set TERMINATION state */ res = failsafe_state_transition(&status, FAILSAFE_STATE_TERMINATION); + } else if (res == TRANSITION_CHANGED) { + mavlink_log_critical(mavlink_fd, "#a FAILSAFE: TERMINATION"); } } } |