MAVLink Diversion Operations with Fencing Research
After setting up geofences that define areas where a drone is allowed or not allowed to fly, they can be used to trigger specific actions or behaviours when the drone approaches or breaches the fencing boundaries.
Defining a Fence
Fence areas can be polygonal or circular and indicate an inclusion or exclusion area. They can be set up in Mission Planner under the PLAN screen and loaded to the autopilot, using the FENCES item in the drop-down box. Seehttps://ardupilot.org/copter/docs/common-geofencing-landing-page.html#general-setup for more setup instructions and types of fences.
Â
Diversion Operations
Upon a fence breach, the following actions can be taken (vehicle-dependent):
Value | Field Name | Description |
---|---|---|
0 | Disable fenced mode. If used in a plan this would mean the next fence is disabled. | |
1 | Fly to geofence MAV_CMD_NAV_FENCE_RETURN_POINT in GUIDED mode. Note: This action is only supported by ArduPlane, and may not be supported in all versions. | |
2 | Report fence breach, but don't take action | |
3 | Fly to geofence MAV_CMD_NAV_FENCE_RETURN_POINT with manual throttle control in GUIDED mode. Note: This action is only supported by ArduPlane, and may not be supported in all versions. | |
4 | Return/RTL mode. | |
5 | Hold at current location. | |
6 | Termination failsafe. Motors are shut down (some flight stacks may trigger other failsafe actions). | |
7 | Land at current location. |
Some actions like activating RTL mode, or diverting to an alternate location can be leveraged to achieve diversion operations. Trigger conditions can be configured in Mission Planner to detect when the drone breaches the fence boundaries; they can be based on relative position, altitude, etc.