RTL Flyaway from GPS Glitch?

FC: 3DR Pixhawk
APM: 3.1.5 Arducopter
GPS: HobbyKing Neo 7m
Platform: scratch built quad

I was testing out my quad on my 3rd actual flight and had a ‘fly away’ type situation that I think was caused by a combination of GPS glitching and a geofence RTL setting. While flying very close LOS, I had GPS failsafe disabled and geofence settings enabled. The wiki states that in that situation a loss of GPS lock will disable the fence settings. Before the flyaway I noticed GPS lock dropping in and out with no affect. According to the logs, I had multiple GPS glitches and then a geofence initiated RTL. Surprisingly, the quad sped off away from home at an altitude less than the fence setting. As it almost hit a nearby tree line, I quickly switched modes back to stabilize and immediately throttle dropped the quad the 15-20 ft.

Is my understanding correct? Is the response from the quad as expected? Thanks for the help.

Yep, I would suggest not using the fence. We just don’t sufficiently check that the GPS is ready again before we try to navigate.

Thanks. I thought it was a more robust safety feature, but will not be using it again unless needed and with GPS failsafe.

I noticed that the GPS glitched 0.09s after the incorrect fence RTL. I’m assuming that valid GPS dependency is perquisite to a fence RTL being activated and the GPS failsafe is meant to prevent problems for RTL or other operations relying on GPS. Best to head the warnings and use GPS failsafe. Just my thoughts in case another stumbles on this.

Thanks again!