ArduPilot has a built-in altitude limit. The parameter is called FENCE_ALT_MAX.
Status: the indoor fence test does not work yet on the simulated drone.
FENCE_TYPE is a bit mask
FENCE_TYPE is a sum of fence kinds, not a single choice. The value in our own parameter file is FENCE_TYPE 7, which means all three kinds are on (1 + 2 + 4).
| Bit value | Fence kind |
|---|---|
1 |
maximum altitude (FENCE_ALT_MAX) |
2 |
circle around home (radius FENCE_RADIUS) |
4 |
polygon (the fence corner points are uploaded separately) |
For example, FENCE_TYPE = 3 is altitude plus circle. Check the value against the ArduPilot version you run, because the list of kinds has changed between releases.
Parameters can be loaded from the indoor.parm file:
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console \
--add-param-file=<repo>/simulation/config/ardupilot/indoor.parm