In the meantime, I worked up a Lua script that inserts a waypoint at the location where a battery failsafe occurs and stores its waypoint index in a file on the SD card. If the waypoint index stored in that file is non-zero at boot time, the mission will resume at the inserted waypoint.
I tested in SITL with a fair amount of success but implore you to do the same before implementing this on a large agricultural vehicle. There is an underlying assumption that the path from the takeoff location to any point in the mission will be clear of obstacles. If you cannot ensure obstacle clearance, DO NOT use this script!
EDIT: I updated the attached script to do a modicum of error checking, ensuring the resume waypoint has not changed location.
If there are DO_COMMAND actions required upon mission entry (such as activating a pump relay), then we’ll have to add those to the script as well.
@iampete, any suggestions for script improvement?
copter-mission-resume.lua (4.9 KB)