- ArduPilot supports fences to allow your vehicle to only fly at certain areas.
- Start the MAVProxy using
mavproxy.py --master=127.0.0.1:14550 --console --map
. - To enable fences,
param set FENCE_ENABLE 1
orfence enable
. - To disable fences,
param set FENCE_ENABLE 0
orfence disable
. FENCE_TYPE
is a bitmask parameter and used to which fence types will be used.- By default,
7
, maximum altitude, circle, and polygon fences are enabled. - To enable minimum altitude, do
param set FENCE_TYPE 15
, and also set minimum altitude likeparam set FENCE_ALT_MIN 10
but with doing this, vehicle can't take off ifFENCE_ALT_MIN
is greater than zero. So for takeoff,fence disable
must be done.
- By default,
- By default, there is a cylindrical fence centered at home location with minimum and maximum altitudes.
- Radius can be set using
param set FENCE_RADIUS 300
. By doing that vehicle can't go further than 300 meters. - Maximum altitude can be set using
param set FENCE_ALT_MAX 50
. By doing that vehicle can't fly higher than 50 meters. - Minimum altitude can also be set using
param set FENCE_ALT_MIN 10
butparam set FENCE_TYPE 15
must be done. By doing that vehicle can't go lower than 10 meters.
- Radius can be set using
- By default, vehicle do RTL when breaches fence but behavior can be set using FENCE_ACTION.
- If you want to disable user input during landing,
param set LAND_REPOSITION 0