SafeRTL is a new mode for Copter that is an alternative to RTL (Return-to-Launch). Instead of flying back home in a straight line, SafeRTL retraces its steps to get back home. It prunes loops, in order to shorten the path.
The visualizer was created while designing the algorithms used to clean up the path. It takes in a .log file and then animates the copter flying along and plots a path which the copter would take to fly home if SafeRTL were activated at that moment. See the readme if you want to try it out yourself.
This pull request creates a new library (AP_SafeRTL) which is used to generate and store a return path in real-time as the vehicle is flown. It also creates a new flight mode for Copter.
Lots of testing will be needed. Hopefully this feature will make it out with copter 3.6 in a few months. One day, a SafeRTL for Rover might also be developed.