Unlock Flyzone Sample

2024-05-17
No Rating

Sample Introduction

The unlock fly zone function provides developers with flight safety notifications, which include listening to flight safety information, flight safety warnings, critical flight safety alerts, return-to-home information, and changes in fly zones around the aircraft. By using the unlock fly zone function, developers can get the fly zone within a specific kilometer range around the aircraft and unlock the fly zone. Once unlocked, no further fly zone notifications will appear, and takeoff restrictions are lifted. If the aircraft reboots, notifications and restrictions will resume.

Fly Zone Division

The fly zone range of MSDK can refer to the enumeration value FlyZoneCategory. For the introduction of fly zone type, you can refer to the GEO Zone Informationopen in new window.

Notes:

  • If the aircraft enters restricted or authorization zones, or exceeds altitude limits, it will hover before the zone and will not be able to advance using the controller sticks.
  • For enterprise models such as M300 RTK, M350 RTK, M30 series, and M3 series, users can directly input the flyZoneID to unlock authorization zones. After restarting the aircraft, authorization zones will be restricted again.
  • For DJI Mini 3 and DJI Mini 3 Pro, refer to the Unlocking a GEO Zone on Your DJI Droneopen in new window. After applying for an unlock on the DJI Flysafe official website, use downloadFlyZoneLicensesFromServer and pushFlyZoneLicensesToAircraft to unlock the authorization zones.
  • Methods for searching fly zones:
    1. Using the MSDK API – getFlyZonesInSurroundingArea() to get the fly zones within a specific range around the aircraft.
    2. Using the DJI official website GEO Zone Informationopen in new window by entering an "address" or "latitude, longitude" to search.
  • To get the fly zone information around the aircraft, MSDK must be connected.

Unlock through License

The unlocking process through license is introduced below. Enhanced warning zones and authorization zones can be unlocked directly through the MSDK API.

  1. Register a DJI account and apply for the licenseopen in new window.
  2. Use downloadFlyZoneLicensesFromServer() to get licenses from the server and download them to the App. Call logInDJIUserAccount() first to log in and get the license for the account.
  3. Use pushFlyZoneLicensesToAircraft() to push licenses with the same serial number as the aircraft to the flight control.
    Note: If successful, use pullFlyZoneLicensesFromAircraft() to get the license list in the aircraft. Developers can perform custom operations based on the current license list.
  4. Use setFlyZoneLicensesEnabled() to enable or disable the license. Once the license is enabled, the aircraft can take off in the fly zone.
    Note: Fly zone license information class – FlyZoneLicenseInfo() introduces license type, validity period, and bound flight control serial number, among other details.

Obtain Unlock Information

There are two methods for obtaining unlock information. One is to pull unlock information belonging to the account from the server using downloadFlyZoneLicensesFromServer(). The other is to obtain unlock information stored on the aircraft's control system using pullFlyZoneLicensesFromAircraft(). Information pulled from the server might be incomplete, while complete unlock information can be obtained from the aircraft.

  1. downloadFlyZoneLicensesFromServer() – obtain account unlock information
  2. pushFlyZoneLicensesToAircraft() – synchronize the unlock information with the aircraft
  3. pullFlyZoneLicensesFromAircraft() – obtain complete unlock information

Interface Calling Process

The figure below provides an example of a complete interface call. Call interfaces according to the actual scenario. For more details, refer to the fly zone management class IFlyZoneManageropen in new window in the MSDK API documentation and sample code.

Sample Acquisition

Ulock Fly Zone Sampleopen in new window

If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.