we are calling "reached_loiter_target" as part of our checks as to whether to fly home or not.
We need to call update_loiter so the L1 controller can update its internal state for the new waypoint which do_RTL has set. Depending on location (but typically), that will mean that L1's reached_loiter_target() will then return false, so we fly home.
This bug was affected by f8d7be5e43 . Any sort of altitude error greater than 10m would delay us entering the landing sequence, allowing the L1 controller to update its state.
when we arm in guided mode then enter a special guided_wait_takeoff
state. We keep motors suppressed until one of the following happens
1) disarm
2) guided takeoff command
3) change to AUTO with a takeoff waypoint as first nav waypoint
4) change to another mode
while in this state we don't go to throttle unlimited, and will refuse
a change to AUTO mode if the first waypoint is not a takeoff. If we
try to switch to RTL then we will instead use QLAND
This state is needed to cope with the takeoff sequence used by QGC on
common controllers such as the MX16, which do this on a "takeoff"
swipe:
- changes mode to GUIDED
- arms
- changes mode to AUTO