From 5b372312740036635a07bc4f12de6c074b628dbb Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 24 Sep 2020 15:12:35 +0200 Subject: [PATCH] commander: fix switch to loiter Sometimes, the mission_result timestamp is the same as the internal_state timestamp which would meant that we would not switch to LOITER even though the takeoff is clearly done at that point. --- src/modules/commander/Commander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index cac5e6053079..21e2164069f3 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -2195,7 +2195,7 @@ Commander::run() * as finished even though we only just started with the takeoff. Therefore, we also * check the timestamp of the mission_result topic. */ if (_internal_state.main_state == commander_state_s::MAIN_STATE_AUTO_TAKEOFF - && (_mission_result_sub.get().timestamp > _internal_state.timestamp) + && (_mission_result_sub.get().timestamp >= _internal_state.timestamp) && _mission_result_sub.get().finished) { const bool mission_available = (_mission_result_sub.get().timestamp > _boot_timestamp)