Flight mode change failed - gps?

Sometimes I get “flight mode change failed” when trying to switch to a flight mode that requires gps (loiter, drift, …).
I cannot determine the reason from the log. Can anybody help me?

ArduCopter 3.6.8

log file

Yes, gps is in most cases the problem. Get a better antenna or a better receiver. Move the telemetry antenna away from the GPS antenna, do not fly near buildings nor trees.

2019-05-26 16:19:25 ArduCopter V3.6.8 (2f409678)
2019-05-26 16:19:25 ChibiOS: d2030d88
2019-05-26 16:19:25 MatekF405 00350034 50485003 20393350
2019-05-26 16:19:25 New mission
2019-05-26 16:19:25 Frame: QUAD
2019-05-26 16:19:25 GPS 1: detected as u-blox at 115200 baud
2019-05-26 16:19:25 u-blox 1 HW: 00080000 SW: ROM CORE 3.01 (107888)
2019-05-26 16:19:40 EKF2 IMU0 in-flight yaw alignment complete
2019-05-26 16:19:43 Flight mode change failed
2019-05-26 16:19:52 Flight mode change failed
2019-05-26 16:20:14 EKF2 IMU0 Origin set to GPS
2019-05-26 16:20:15 EKF2 IMU0 is using GPS

You were trying to change to modes that required positioning information
before the estimator (“EKF2”) was using the GPS for positioning. This
isn’t just a matter of having enough satellites; the EKF has other quality
measures it uses.

If you have the patience, put the vehicle into LOITER mode and wait for it
to be armable in that mode before takeoff. This will ensure things like
your RTL location is correct.

thanks alot, that is exactly what I was looking for.
So the message “EKF2 IMU0 Origin set to GPS” is
the indicator that flight modes like loiter etc are ready to use ?
How will I know, the message was send, is there a telemetry status ?

thanks alot, that is exactly what I was looking for.
So the message “EKF2 IMU0 Origin set to GPS” is
the indicator that flight modes like loiter etc are ready to use ?

Nah, the following one, “using GPS”.

How will I know, the message was send, is there a telemetry status ?

These are all text messages which will appear in a GCS - or an OSD.

The same information can be had in a more machine-friendly form in a
particular mavlink message - but I don’t think any GCS actually uses it…