[Canberrauav] FW: Fwd: failsafe
tridge at samba.org
Sat Dec 17 12:30:25 EST 2011
You might be interested in having a look at the code I pushed to
ArduPlane master yesterday. It adds geo-fencing as a standard feature
for ArduPlane. I'll post some docs on the wiki soon, but if you look
through the code it shouldn't be too hard to work out.
I test flew it for the first time this morning and it worked very
well. It is currently set to fly back to a 'return point' on fence
breach and optionally set a digital pin high, but it is trivial to add
other behaviour. For CanberraUAV we will use the digital pin to tell our
separate failsafe device that it should activate.
The core "point in polygon" code is in libraries/AP_Math/polygon.cpp and
the rest of the geo-fecing logic is in ArduPlane/geofence.pde.
I added this to the standard ArduPlane build as I think it is ideal for
R/C training, as it effectively gives you an uncrashable plane if you
set the boundaries right (it has optional height limits on the fence
too). I did some quite crazy stunts today to try and crash it, and each
time it caught the fence breach and flew back to the middle. It even
recovered from me flying it upside down in manual and diving it through
the lower altitude limit (while inverted). It righted itself and flew
back to the middle.
Please let me know if you find any bugs!
More information about the Canberrauav