From 24819ce7b128e7b4536282ea862a118bf786f408 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 3 Mar 2017 09:33:20 +0000 Subject: [PATCH] commander: no datalink failsafe on ground On SITL startup we got a datalink lost failsafe message whenever home was initialized. The reason that in standalone SITL, there is usually no datalink connected. However, on ground, we shouldn't really failsafe, therefore it makes sense not to enter the state in the first place. --- src/modules/commander/state_machine_helper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index ee7d08b646..7457955107 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -844,10 +844,10 @@ bool set_nav_state(struct vehicle_status_s *status, status->nav_state = vehicle_status_s::NAVIGATION_STATE_DESCEND; enable_failsafe(status, old_failsafe, mavlink_log_pub, reason_no_gps); - /* also go into failsafe if just datalink is lost */ + /* also go into failsafe if just datalink is lost, and we're actually in air */ - } else if (status->data_link_lost && data_link_loss_act_configured) { enable_failsafe(status, old_failsafe, mavlink_log_pub, reason_no_datalink); + } else if (status->data_link_lost && data_link_loss_act_configured && !landed) { set_data_link_loss_nav_state(status, armed, status_flags, data_link_loss_act);