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.
This commit is contained in:
Julian Oes 2020-09-24 15:12:35 +02:00 committed by Daniel Agar
parent 46f0388fc7
commit b454095776
1 changed files with 1 additions and 1 deletions

View File

@ -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)