TauLabs/TauLabs — pull request #604 by kubark42 (2013-06-06 13:42:16+00:00)
Title: Geofencing

This implements a geo-fencing module. This has been tested and works. All fence coordinates are in lat-lon-alt, where altitude is referenced to MSL.

Note: there is a hysteresis problem. The hysteresis occurs when the vehicle comes back into the boundary. As of right now it simply returns control to the transmitter. While this is not ideal, it's the most generic response.

Geofencing could have a latch, by which it forces the completion of the failure mode, such as forcing a complete return to home before relinquishing control to the user, but I don't see any obvious test which would work for most cases. There are a wide variety of reasons to want geofencing, from regulatory requirements, to reduced risks of losing a model while flying FPV, to unusual attitude and position recovery for student pilots.