diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-07-06 21:37:26 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-07-06 21:37:26 +0200 |
commit | 06f08ad04d4cb21047944f350e4a75e88914e1e1 (patch) | |
tree | 709116d144045efd8b4fdb08f42d65a08260648f /src/modules/commander/commander.cpp | |
parent | 829a317d23093894c3d8974cce887ab3c19eba08 (diff) | |
download | px4-firmware-06f08ad04d4cb21047944f350e4a75e88914e1e1.tar.gz px4-firmware-06f08ad04d4cb21047944f350e4a75e88914e1e1.tar.bz2 px4-firmware-06f08ad04d4cb21047944f350e4a75e88914e1e1.zip |
commander: require home position for MISSION, fallback to LOITER
Diffstat (limited to 'src/modules/commander/commander.cpp')
-rw-r--r-- | src/modules/commander/commander.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index efa26eb97..1da364aa5 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1718,6 +1718,13 @@ set_main_state_rc(struct vehicle_status_s *status, struct manual_control_setpoin } print_reject_mode(status, "AUTO_MISSION"); + + // fallback to LOITER if home position not set + res = main_state_transition(status, MAIN_STATE_AUTO_LOITER); + + if (res != TRANSITION_DENIED) { + break; // changed successfully or already in this state + } } // fallback to POSCTL |