Inclusion and Exclusion Fences


Copter and Rover includes support for polygon fences with up to 70 points and circular fences. Either may be selected to be inclusion or exclusion type. The purpose of these fences are to attempt to stop your vehicle from flying into (exclusion), or out of (inclusion), the fences by initiating a failsafe action like RTL or, if flying in Loiter mode, the vehicle will normally stop before breaching the fence

This feature is an extension of the simpler cylindrical fence and can be combined with it.

Like the cylindrical fence, Copter will stop increasing altitude at FENCE_ALT_MAX in Loiter, PosHold, and AltHold modes. In other modes, it will execute the FENCE_ACTION if the altitude limit is exceeded and active.

See cylindrical fence for fence parameters, which also apply to these polygonal fences.

These fences are created and treated in a similar way to mission command lists and rally point lists and loaded into the autopilot.

Enabling Fences in Mission Planner

  • Connect your Autopilot to the Mission Planner

  • Go to the CONFIG| GeoFence screen

  • Click “Enable” and set Type to “All” or another option that includes “Polygon”. Circle refers to the HOME centered, cylindrical fence. Altitude only, limits maximum altitude (everywhere).

  • Leave the Action as “RTL or Land”. Although, you can select other failsafe actions.

  • Go to the PLAN screen, and select FENCE from the dropdown box in the upper right part of the map display.

  • For a circular fence, simply click on the map and a circular exclusion fence is added to the list. You can change its radius with the first parameter of the item. You can also change it from an exclusion fence to a circular inclusion fence, via the item’s dropdown box.

  • For a polygonal fence, use the polygon tool on the left side of the map screen. Select “Draw a Polygon”, and draw the boundary points with map clicks, then select if its an inclusion or exclusion fence type. It will be added to the fence point list.

  • Upload the fence(s) to the vehicle using “Write” button below the map. You can also read the fence list from the autopilot with the “Read” button.


You can define many inclusion and exclusion fences. However,multiple inclusions fences, including the cylindrical fences must overlap, since the vehicle can operate only within the complete overlap area of all of the inclusion fences. Exclusion fences may be placed within or outside of inclusion fences.


In order to upload or download these fences from Mission Planner the connected link must be using MAVLink2 protocol. Normally, since the USB conenction is used, this protocol is default. However, radio linked connections may use MAVLink1 by default and would need to be changed to MAVLink2 in order to upload and download across them.


You can have both the cylindrical fences and inclusion/exclusion fences and choose to use just the HOME centerd “tin-can” for a flight by selecting only the “Circle” or “Altitude and Circle” for FENCE_TYPE. You can chose to enable the cylindrical fences, these inclusion/exclusion fences, and/or altitude limit, in any combination, with this parameter.

Combining with the Cylindrical Fence

A polygon fence can be used in combination with the cylindrical fences and the failsafe behaviour (i.e. stop at the fence or RTL) will trigger at whichever barrier the vehicle reaches first (i.e. the green line shown below)


Please see the Cylindrical Fence page for additional warnings and instructions including how to enable/disable the fence with the RC channel auxiliary switches.