forked from Archive/PX4-Autopilot
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:
parent
46f0388fc7
commit
b454095776
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue