← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The drawn fence stored on the aircraft could not be loaded

Stops itMissions, fence, rally points, terrain

What ArduPilot says:

Also explained here: 2 more
  • AC_Fence: polygon read failed
  • PolyFence: Multiple return points found

FENCE_TYPE includes drawn fences (bit 2), and the polygons and circles stored on the aircraft are not in memory. ArduPilot loads them once it knows where it is. The load fails when what is stored makes no sense: a polygon with fewer than 3 points, a circle with no radius, two return points, an item of unknown kind. The warning lines that begin “AC_Fence:” or “PolyFence:”, and “Fence corrupt”, say which. An aircraft with no drawn fence at all passes this check.

What to do, most likely first

  1. The stored fence is damaged: an upload was cut short, or it was written by a much older firmware.

    CheckRead the fence back in the ground station's Plan screen: does it look like what you drew? One of the warning lines above among the start-up messages confirms it.

    FixClear the fence on the aircraft, upload it again from the ground station, then reboot.

  2. The fence was uploaded a moment ago and is still being loaded.

    FixWait a second or two. If the message stays, it is one of the other causes.

  3. The board has too little free memory to hold all the fence points.

    CheckA fence of many points on a small board, with scripting or other memory-hungry features switched on.

    FixDraw the fence with fewer points, or free memory by switching off features you do not use, and reboot.

When BRD_SD_FENCE is above 0 the fence is kept in a file on the SD card; a missing card then shows as “Failed to open fence storage”.

Parameters to look at

ParameterWhat it is
FENCE_TYPEFence Type
FENCE_TOTALFence polygon point total
BRD_SD_FENCE SDCard Fence size
The code that sends it

Polygon fence(s) invalid

libraries/AC_Fence/AC_Fence.cpp AC_Fence::pre_arm_check_polygon() · Open in ArduPilot Copter-4.7.1

AC_Fence: invalid polygon vertex count N

libraries/AC_Fence/AC_PolyFence_loader.cpp AC_PolyFence_loader::load_from_eeprom() · Open in ArduPilot Copter-4.6.3

libraries/AC_Fence/AC_PolyFence_loader.cpp AC_PolyFence_loader::load_from_storage() · Open in ArduPilot Copter-4.7.1

Fence corrupt

libraries/AC_Fence/AC_PolyFence_loader.cpp AC_PolyFence_loader::scan_eeprom() · Open in ArduPilot Copter-4.7.1

AC_Fence: latlon read failed

libraries/AC_Fence/AC_PolyFence_loader.cpp AC_PolyFence_loader::load_from_eeprom() · Open in ArduPilot Copter-4.6.3

libraries/AC_Fence/AC_PolyFence_loader.cpp AC_PolyFence_loader::load_from_storage() · Open in ArduPilot Copter-4.7.1

And 4 more messages, sent from the same places.

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer