aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-04-23 19:03:03 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-04-23 19:03:03 +0200
commitdb474072a7ada907d62ac994d961ac10d90d92a6 (patch)
treeffbdcd903db4c4859cad8139acceb153f8ee018e /src/modules/commander
parent34597599fcac2d76e9c8f35b12f18f1bbcb04bbe (diff)
parent56592ec77d3863f135c10619b15a0591f957fdbf (diff)
downloadpx4-firmware-db474072a7ada907d62ac994d961ac10d90d92a6.tar.gz
px4-firmware-db474072a7ada907d62ac994d961ac10d90d92a6.tar.bz2
px4-firmware-db474072a7ada907d62ac994d961ac10d90d92a6.zip
Merge branch 'rc_timeout' into mpc_rc
Diffstat (limited to 'src/modules/commander')
-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 829d6884b..47756dae0 100644
--- a/src/modules/commander/commander.cpp
+++ b/src/modules/commander/commander.cpp
@@ -1100,7 +1100,7 @@ int commander_thread_main(int argc, char *argv[])
status_changed = true;
}
- /* update subsystem */
+ /* update position setpoint triplet */
orb_check(pos_sp_triplet_sub, &updated);
if (updated) {
@@ -1319,10 +1319,15 @@ int commander_thread_main(int argc, char *argv[])
} else {
/* failsafe for manual modes */
- transition_result_t res = failsafe_state_transition(&status, FAILSAFE_STATE_RTL);
+ transition_result_t res = TRANSITION_DENIED;
+
+ if (!status.condition_landed) {
+ /* vehicle is not landed, try to perform RTL */
+ res = failsafe_state_transition(&status, FAILSAFE_STATE_RTL);
+ }
if (res == TRANSITION_DENIED) {
- /* RTL not allowed (no global position estimate), try LAND */
+ /* RTL not allowed (no global position estimate) or not wanted, try LAND */
res = failsafe_state_transition(&status, FAILSAFE_STATE_LAND);
if (res == TRANSITION_DENIED) {