Skip to content

Commit

Permalink
Change poly geofence to inclusion and exclusion fences
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg authored and rmackay9 committed Jun 15, 2020
1 parent 57d9665 commit 95bcda3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 29 deletions.
6 changes: 3 additions & 3 deletions common/source/docs/common-ac2_simple_geofence.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _common-ac2_simple_geofence:

[copywiki destination="copter,rover"]
====================
Cylindrical GeoFence
====================
=================
Cylindrical Fence
=================

Overview
========
Expand Down
7 changes: 4 additions & 3 deletions common/source/docs/common-advanced-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ tuning options for the vehicle.
[/site]
Brushless ESCs <common-dshot>
Extended Kalman Filter (EKF) <common-apm-navigation-extended-kalman-filter-overview>
[site wiki="copter,plane,rover"]
Flight Time Recorder <common-flight-time-recorder>
[site wiki="copter,rover"]
Fence Failsafes <common-geofencing-landing-page>
[/site]
Flight Time Recorder <common-flight-time-recorder>
[site wiki="plane"]
Fly-By-Wire Low Altitude Limit <fly-by-wire-low-altitude-limit>
[/site]
FPort Setup <common-FPort-receivers>
GeoFencing Failsafe <common-geofencing-landing-page>
GeoFencing Failsafe <common-geofencing-landing-page>
GPIOs <common-gpios>
GPS for Yaw (aka Moving Baseline) <common-gps-for-yaw>
Ground Control Station Only Operation <common-gcs-only-operation>
Expand Down
22 changes: 20 additions & 2 deletions common/source/docs/common-geofencing-landing-page.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
.. _common-geofencing-landing-page:

[site wiki="plane"]
==========
GeoFencing
==========
[/site]
[site wiki="copter,rover"]
======
Fences
======
[/site]

[site wiki="plane"]
ArduPilot supports failsafes generated by several types of GeoFences (boundaries described by latitude/longitude and/or altitude) to prevent the vehicle from traveling higher or further than desired, or into unwanted areas. Types of GeoFences supported varies by vehicle.
[/site]
[site wiki="plane"]
ArduPilot supports failsafes generated by several types of Fences (boundaries described by latitude/longitude and/or altitude) to prevent the vehicle from traveling higher or further than desired, or into unwanted areas. Types of Fences supported varies by vehicle.
[/site]

[site wiki="copter,rover"]
For Copter, the Cylindrical Geo-Fence is a simple "tin-can" centered around HOME. In addition, there can also be inclusion and exclusion fences drawn, either circular or polygonal, or both, at various locations.

Inclusion and Exclusion Fences are defined easily in Mission Planner under the PLAN screen and loaded to the autopilot, using the FENCES item in the drop down box, just like Missions or Rally Points are planned.
[/site]

.. toctree::
:maxdepth: 1

[site wiki="copter,rover"]
Cylindrical Geo-Fencing Failsafe <common-ac2_simple_geofence>
Polygon Geo-Fencing Failsafe <common-polygon_fence>
Cylindrical Fence Failsafe <common-ac2_simple_geofence>
Inclusion/Exclusion Fence Failsafe <common-polygon_fence>
[/site]
[site wiki="plane"]
Geo-Fencing Failsafes <geofencing>
Expand Down
47 changes: 26 additions & 21 deletions common/source/docs/common-polygon_fence.rst
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
.. _common-polygon_fence:

[copywiki destination="copter,rover"]
================
Polygon GeoFence
================
==============================
Inclusion and Exclusion Fences
==============================

Overview
========

Copter and Rover includes support for a polygon geofence with up to 70 points. The purpose of this fence is to attempt to stop your vehicle from flying out of the polygon by initiating an RTL or, if flying in Loiter mode, the vehicle will normally stop before breaching the fence. This feature is an extension of the simpler :ref:`cylindrical fence <common-ac2_simple_geofence>`.
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 :ref:`cylindrical fence <common-ac2_simple_geofence>` and can be combined with it.

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


.. youtube:: U3Z8bO3KbyM
:width: 100%

Enabling the Fence in Mission Planner
=====================================
Enabling Fences in Mission Planner
==================================

.. youtube:: SEm4nVfbg00
:width: 100%

- 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"
- 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, :ref:`cylindrical fence <common-ac2_simple_geofence>`. Altitude only, limits maximum altitude (everywhere).


.. image:: ../../../images/polygon_fence_enable.png
:target: ../_images/polygon_fence_enable.png
:width: 500px

- Select the Action . "RTL or Land" is recommended.
- Go to the **PLAN** screen and select FENCE from the upper-rigth drop-down box.
- Right-mouse-button click on the map and select "Draw Polygon" >> "Add Polygon Point"
- Click on other points on the map to define the polygon
- 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.

.. image:: ../../../images/exclusion-zone.png
:target: ../_images/exclusion-zone.png
:width: 500px


- 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.

.. image:: ../../../images/polygon_add_point.png
:target: ../_images/polygon_add_point.png
:width: 500px

- After the polygon has been defined you must Right-mouse-button click and "Draw Polygon" >> "Set Return Location". This location is not actually used by Copter or Rover, but it must be set because the same underlying library is used as Plane.
- 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.

.. image:: ../../../images/polygon_add_return_point.png
:target: ../_images/polygon_add_return_point.png
:width: 500px
.. note:: You can define many inclusion and exclusion fences. However,multiple inclusions fences, including the :ref:`cylindrical fences <common-ac2_simple_geofence>` 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.

- Upload the polygon geofence to the vehicle using WRITE button on the bottom.

.. image:: ../../../images/polygon_upload.png
:target: ../_images/polygon_upload.png
:width: 500px
.. tip:: You can have both the :ref:`cylindrical fences <common-ac2_simple_geofence>` 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 :ref:`FENCE_TYPE<FENCE_TYPE>`. You can chose to enable the :ref:`cylindrical fences <common-ac2_simple_geofence>`, these inclusion/exclusion fences, and/or altitude limit, in any combination, with this parameter.

Combining with the Cylindrical Fence
====================================

The polygon fence can be used in combination with the :ref:`cylindrical fences <common-ac2_simple_geofence>` and the :ref:`FENCE_ACTION<FENCE_ACTION>` (i.e. LAND, RTL,etc.) will trigger at whichever barrier the vehicle reaches first (i.e. the green line shown below)
A polygon fence can be used in combination with the :ref:`cylindrical fences <common-ac2_simple_geofence>` 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)


.. image:: ../../../images/copter_polygon_circular_fence..png
:target: ../_images/copter_polygon_circular_fence..png
Expand Down
Binary file added images/exclusion-zone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/polygon_add_point.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/polygon_fence_enable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 95bcda3

Please sign in to comment.