diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-14 11:03:02 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-14 11:03:02 +0100 |
commit | 23d0c6f8dd1a0b9aa64dafe26cfd56e43637c5ee (patch) | |
tree | 6569fe4ba2956cc74bba4294d76b91be201c60dc /src/modules/commander | |
parent | 367d5d0cf28d6c857fdcd6c4ad20809f9e52e310 (diff) | |
download | px4-firmware-23d0c6f8dd1a0b9aa64dafe26cfd56e43637c5ee.tar.gz px4-firmware-23d0c6f8dd1a0b9aa64dafe26cfd56e43637c5ee.tar.bz2 px4-firmware-23d0c6f8dd1a0b9aa64dafe26cfd56e43637c5ee.zip |
temporary workaround to trigger failsafe with remote control
Diffstat (limited to 'src/modules/commander')
-rw-r--r-- | src/modules/commander/commander.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 40562a4e1..9ed9051fa 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1189,6 +1189,16 @@ int commander_thread_main(int argc, char *argv[]) } } + /* Flight termination in manual mode if assisted switch is on easy position //xxx hack! */ + if (armed.armed && status.main_state == MAIN_STATE_MANUAL && sp_man.assisted_switch > STICK_ON_OFF_LIMIT) { + transition_result_t flighttermination_res = flighttermination_state_transition(&status, FLIGHTTERMINATION_STATE_ON, &control_mode); + if (flighttermination_res == TRANSITION_CHANGED) { + tune_positive(); + } + } else { + flighttermination_state_transition(&status, FLIGHTTERMINATION_STATE_OFF, &control_mode); + } + /* handle commands last, as the system needs to be updated to handle them */ orb_check(cmd_sub, &updated); |