Marc's Public Blog - Remote Control Aircraft


All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Dining | Diving | Electronics | Exercising | Flying | Hiking | Linux | Linuxha | Museums | Public | Rc | Sciencemuseums | Snow | Solar | Trips



>>> Back to post index <<<

2015/11/06 Using Ardupilot Geofencing As An Altitude Deck
π 2015-11-06 00:00 in Rc
I was interested in using geofencing only to get an altitude deck. As in if for some reason, I'm flying too low, the autopilot would take over and bring the airplane back to a proper altitude. This lets me fly freely at any altitude, but if some reason I lose control (or video during FPV and the aircrafts descends too much before I have time to hit RTL), I have the peace of mind that Arduplane will take over.

This was however not easy to setup at all because geofencing is not really designed with that use case in mind in APM::Plane. As discussed in this bug: https://github.com/diydrones/ardupilot/issues/2984 , in arducopter you can simply set an altitude limit but not in Arduplane.

So, what you need to do is the following:

  • FENCE_ACTION,1
  • FENCE_AUTOENABLE,0
  • FENCE_CHANNEL,8 =-> change to your channel
  • FENCE_MAXALT,130 => you must set a max alt, or min alt will not work :(
  • FENCE_MINALT,50
  • FENCE_RETALT,100
  • FENCE_RET_RALLY,1 => very important, means that guided will go back to the nearest rally point, or if you have none, to your RTL/takeoff point.
  • You're not done though, now you have to upload a useless geofence area or nothing will work. As per http://plane.ardupilot.com/wiki/geofencing/ , I uploaded a geofence as big as the US, and put the geofence return point in the middle of the ocean.
    The end result is that the geofence return point is too far, so when guided mode kicks in, it looks for a rally point, I have none, and then falls back to the RTL/takeoff point, which is what I wanted.

    Sadly, though, I was only able to setup that useless geofence area with mission planner.

  • apmplanner did not allow me to set a geofence, or at least http://plane.ardupilot.com/wiki/geofencing/ does not really show how to get apmplanner ot do it
  • you'd think Tower, the new android app, would let you setup a geofence, but I didn't find how to do it, and the documentation is sadly non existent ( https://github.com/DroidPlanner/Tower/wiki and https://3drobotics.com/kb/tower-best-practices/ do not count as documentation).
  • So there you go, this can be made to work, but apparently you have to use mission planner (which means Virtualbox for me since I'm on linux), and you need to setup a huge polygon, a gence return point that is very far away from where you'll ever fly, and make sure that you do set FENCE_MAXALT or FENCE_MINALT won't work (which seems to be a bug, as of AP 3.4).


    More pages: August 2016 July 2016 December 2015 November 2015 October 2015 September 2015 August 2015 May 2015 April 2015 August 2014 July 2014 February 2013 May 2011 October 2010 August 2010 July 2010 February 2010 January 2010 October 2009 September 2009 July 2009 June 2009 May 2009 July 2008 June 2007 May 2007 April 2007 March 2007 February 2007

    >>> Back to post index <<<