DJI Mobile SDK Documentation

      class FlyZoneManager

      class FlyZoneManager implements DJIParamAccessListener
      Package:dji.sdk.flightcontroller
      Description:

      Fly Zone Manager gives information about nearby fly zones, and APIs to unlock zones that can be unlocked. Depending on location, there are three types of fly zones possible:

    • CIRCLE: Cylinder or truncated cone volume with four levels of restriction:
      • Warning Zones : no restriction
      • Enhanced warning zones : Flight restricted, can be unlocked for flight when the user logs into their DJI account
      • Authorization zones : Flight restricted, can be unlocked for flight when the user logs into their DJI account and the account has been authorized to unlock authorization zones.
      • Restricted zones : Flight restricted

    • POLY: Fly zone that consists of one or more sub fly zones that are cylinders or complex volumes with different height limitations. A height limitation of 0 means flight is completely restricted. This is used by Spark, Mavic, Phantom 4 Series, Inspire 2 and Matrice 200 series.

    • On the Phantom 3, Inspire 1, M100, M600, A3/N3 series of products, there can also be a buffer area with radius about 23 km around a restricted fly zone where flight height is limited to 120m.

      Not supported by DJI Air 2S.
      Class Members:
      State Updates
      method
      method setFlyZoneStateCallback
      @Deprecated
      void setFlyZoneStateCallback(@Nullable FlyZoneState.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Sets up the setFlyZoneStateCallback for obtaining FlyZoneState.

      Input Parameters:
      @Nullable FlyZoneState.Callback callbackFlyForbidStatusUpdatedCallback callback.
      method setFlySafeNotificationCallback
      void setFlySafeNotificationCallback(@NonNull FlySafeNotification.Callback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Sets up the setFlyZoneStateCallback for obtaining FlySafeNotification.

      Input Parameters:
      @NonNull FlySafeNotification.Callback callbackAn object value of FlySafeNotification.
      method setBasicDatabaseUpgradeProgressUpdatedCallback
      void setBasicDatabaseUpgradeProgressUpdatedCallback(BasicDatabaseUpgradeProgressUpdatedCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Sets up the setBasicDatabaseUpgradeProgressUpdatedCallback for obtaining the basic database upgrade progress.

      Input Parameters:
      BasicDatabaseUpgradeProgressUpdatedCallback callbackBasicDatabaseUpgradeProgressUpdatedCallback callback.
      Self Unlocking
      method
      method getFlyZonesInSurroundingArea
      void getFlyZonesInSurroundingArea(
      @NonNull final CompletionCallbackWith<ArrayList<FlyZoneInformation>> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets all the fly zones within 20km of the aircraft. During simulation, this method is available only when the aircraft location is within 50km of (37.460484, -122.115312) or within 50km of (22.5726, 113.8124499). Use of the geographic information provided by DJIFlyZoneManager is restricted. Refer to the DJI Developer Policy.

      Input Parameters:
      @NonNull final CompletionCallbackWith<ArrayList<FlyZoneInformation>> callbackThe execution callback with the returned value(s).
      method getUnlockedFlyZonesForAircraft
      void getUnlockedFlyZonesForAircraft(@NonNull final CompletionCallbackWith<List<FlyZoneInformation>> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets a list of authorization fly zones unlocked by the account for the connected aircraft. It includes fly zones unlocked by the Flight Planner (http://www.dji.com/flysafe/geo-system#planner), and the ones unlocked during flight using DJI Go or any DJI Mobile SDK based application. This list does NOT include fly zones unlocked by custom unlocking. For Inspire 1 and Phantom 3 series, the list is fetched from the server. If the internet is not accessible, the cached local data will be used. For the other products, the list is fetched from the aircraft.

      Input Parameters:
      @NonNull final CompletionCallbackWith<List<FlyZoneInformation>> callbackThe execution callback with the returned value(s).
      method unlockFlyZones
      void unlockFlyZones(@Size(min = 1) final ArrayList<Integer> ids,
      @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Unlocks the selected fly zones. This method can be used to unlock authorization zones. After unlocking the zones, flight will be unrestricted in those zones until the unlock expires. The unlocking record will be linked to the user's account and will be accessible to DJI Go and other DJI Mobile SDK based applications.
      Data Protection Notes - Calling this method will send the following protected data to DJI server:
      - User account information
      - The serial number of the connected aircraft.

      Input Parameters:
      @Size(min = 1) final ArrayList<Integer> idsThe IDs of AUTHORIZATION zones.
      @Nullable final CompletionCallback callbackThe execution callback with the returned execution result.
      method unlockAuthorizationFlyZone
      void unlockAuthorizationFlyZone(@Size(min = 1) final int id, @Nullable final CompletionCallback<DJIError> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Unlock the authorization fly zone. After unlocking the authorization fly zone, the aircraft will be able to take off normally in the authorization fly zone, and the authorization fly zone will continue to be banned after reboot the aircraft.

      Input Parameters:
      @Size(min = 1) final int idThe ID of AUTHORIZATION zone.
      @Nullable final CompletionCallback<DJIError> callbackThe execution callback with the returned execution result.
      Unlocked Zone Groups
      method
      method reloadUnlockedZoneGroupsFromServer
      void reloadUnlockedZoneGroupsFromServer(final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Reloads the unlocked zone groups unlocked by the current user's account from the server. For all products besides Phantom 3 and Inspire 1 series this includes both self unlocked and custom unlocked zones. Each unlocked zone group corresponds to one aircraft serial number. After launch, SDK will call this method once. It will call this method again when either the network connection or the current account state changes (e.g. when a new user successfully logs in). Call this method any other time to trigger the reloading manually. Calling this method will NOT synchronize the loaded zone groups onto the aircraft. To get a list of groups currently loaded from the server, call getLoadedUnlockedZoneGroups. User will need to manually call syncUnlockedZoneGroupToAircraft to synchronize the unlocked group to the connected aircraft after the unlocked zone groups are reloaded. This feature is not supported by Inspire 1 or Phantom 3 series. For the other products, it can be used when isCustomUnlockZoneSupported returns true.

      Input Parameters:
      final CompletionCallback callbackcompletion callback to receive the result.
      method getLoadedUnlockedZoneGroups
      void getLoadedUnlockedZoneGroups(final CommonCallbacks.CompletionCallbackWith<List<UnlockedZoneGroup>> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the unlocked zone groups loaded from the server. Each zone group corresponds to one aircraft. The loaded zone groups will NOT be synchronized to the aircraft automatically. User need to manually invoke syncUnlockedZoneGroupToAircraft to synchronize the unlocked zone group to the connected aircraft. Invoke reloadUnlockedZoneGroupsFromServer to trigger the reloading of unlocked zone groups manually. This feature is not supported by Inspire 1 or Phantom 3 series. For the other products, it can be used when isCustomUnlockZoneSupported returns true.

      Input Parameters:
      final CommonCallbacks.CompletionCallbackWith<List<UnlockedZoneGroup>> callbackThe execution callback with the returned result.
      method syncUnlockedZoneGroupToAircraft
      void syncUnlockedZoneGroupToAircraft(final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Synchronizes the unlocked zone group to the connected aircraft. SDK will select the unlocked zone group that matches the serial number of the connected aircraft. After the unlocked zone group is synchronized to the aircraft successfully, the latest unlocked fly zones and the custom unlock zones on the aircraft can be checked by the follow methods:

      - Unlocked fly zones: getUnlockedFlyZonesForAircraft
      - Custom unlock zones: getCustomUnlockZonesFromAircraft This feature is not supported by Inspire 1 or Phantom 3 series. For the other products, it can be used when isCustomUnlockZoneSupported returns true.

      Input Parameters:
      final CompletionCallback callbackThe completion callback with the returned result.
      method deleteAllUnlockingLicenses
      void deleteAllUnlockingLicenses(@Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Deletes all unlocking licenses in the aircraft. Supported only by Mavic Mini, DJI Mini 2, DJI Mini SE and Matrice 300 RTK.

      Input Parameters:
      @Nullable final CompletionCallback callbackThe execution callback.
      Custom Unlocking
      method
      method getCustomUnlockZonesFromAircraft
      void getCustomUnlockZonesFromAircraft(final CompletionCallbackWith<List<CustomUnlockZone>> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the Custom Unlock Zones currently on the aircraft. This method can only be used when isCustomUnlockZoneSupported is true.

      Input Parameters:
      final CompletionCallbackWith<List<CustomUnlockZone>> callbackCompletion callback that receives the execution result.
      method enableCustomUnlockZone
      void enableCustomUnlockZone(@Nullable CustomUnlockZone zone, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Enables an Custom Unlock Zones that is on the aircraft. All Custom Unlock Zones on the aircraft can be retrieved with getCustomUnlockZonesFromAircraft. At any time, only one Custom Unlock Zone can be enabled. Enabling an Custom Unlock Zone will disable the previously enabled zone. This method can only be used when isCustomUnlockZoneSupported is true.

      Input Parameters:
      @Nullable CustomUnlockZone zoneCustom Unlock Zone to enabled. If zone is nil, only the previously enabled zone will be disabled.
      @Nullable final CompletionCallback callbackcompletion callback to receive the result.
      method getEnabledCustomUnlockZone
      void getEnabledCustomUnlockZone(@NonNull final CompletionCallbackWith<CustomUnlockZone> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Gets the currently enabled Custom Unlock Zone. This method can only be used when isCustomUnlockZoneSupported is true.

      Input Parameters:
      @NonNull final CompletionCallbackWith<CustomUnlockZone> callbackCompletion callback that receives the execution result.
      method isCustomUnlockZoneSupported
      boolean isCustomUnlockZoneSupported()
      Package:dji.sdk.flightcontroller
      Description:

      true if an aircraft is connected with flight controller firmware that supports Custom Unlock Zones. Aircraft that support Custom Unlock zones are also able to disable unlocked fly zones temporarily.

      Return:
      booleanA boolean value to check if Custom Unlock Zone supported.
      FlySafe Database
      method
      method getPreciseDatabaseVersion
      void getPreciseDatabaseVersion(@NonNull final CompletionCallbackWith<String> callback)
      Package:dji.sdk.flightcontroller
      Description:

      The version of the precise fly zone database in the firmware of the aircraft. It is null if getPreciseDatabaseState is INITIALIZING. The precise database is supported by Phantom 4 series, Inspire 2, M200 series, Mavic and Spark.

      Input Parameters:
      @NonNull final CompletionCallbackWith<String> callbackThe execution callback.
      method getPreciseDatabaseState
      void getPreciseDatabaseState(@NonNull final CompletionCallbackWith<FlyZoneDatabaseState> callback)
      Package:dji.sdk.flightcontroller
      Description:

      The fly zone database state in the firmware of the aircraft. The SDK will compare the version of the database on the aircraft against the latest one online. When the aircraft database is out-of-date, the user should use DJI Go or Assistant 2 to update the firmware. This database is supported by Phantom 4 series, Inspire 2, M200 series, Mavic and Spark.

      Input Parameters:
      @NonNull final CompletionCallbackWith<FlyZoneDatabaseState> callbackThe execution callback.
      method getBasicDatabaseState
      void getBasicDatabaseState(@NonNull final CompletionCallbackWith<FlyZoneDatabaseState> callback)
      Package:dji.sdk.flightcontroller
      Description:

      Get the state of the basic fly zone database on the mobile device. The SDK will compare the version of the local database against the latest one online. When the local database is out-of-date, call startBasicDatabaseUpgrade to start updating the database. If the update is compulsory (for safety reasons), SDK will start the update automatically. The basic database is used by DJI aircraft that do not support the precise database (e.g. Phantom 3 series, Inspire 1 series).

      Input Parameters:
      @NonNull final CompletionCallbackWith<FlyZoneDatabaseState> callbackThe execution callback with the returned FlyZoneDatabaseState enum value(s).
      method getBasicDatabaseVersion
      void getBasicDatabaseVersion(@NonNull final CompletionCallbackWith<String> callback)
      Package:dji.sdk.flightcontroller
      Description:

      The version of the basic fly zone database on the mobile device. It is null if the local file cannot be parsed by SDK. The basic database is used by DJI aircraft that do not support the precise database (e.g. Phantom 3 series, Inspire 1 series).

      Input Parameters:
      @NonNull final CompletionCallbackWith<String> callbackThe execution callback with the returned String value.
      method startBasicDatabaseUpgrade
      void startBasicDatabaseUpgrade(@Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Starts the upgrde of the basic database. Internet access is required. When the upgrade is started successfully, use onUpdate to monitor the progress.

      Input Parameters:
      @Nullable final CompletionCallback callbackcompletion callback to receive the result.
      method stopBasicDatabaseUpgrade
      void stopBasicDatabaseUpgrade(@Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      Description:

      Stops the in-progress upgrade of the basic database.

      Input Parameters:
      @Nullable final CompletionCallback callbackcompletion callback to receive the result.
      enum FlyZoneDatabaseState
      @EXClassNullAway
      enum FlyZoneDatabaseState
      Package:dji.common.flightcontroller.flyzone
      Description:

      The state of the fly zone database on the aircraft.

      Enum Members:
      INITIALIZINGSDK is fetching the information of the database.
      NO_INTERNET_CONNECTIONSDK cannot access the Internet, so it cannot compare the database version with the latest one on the Internet.
      OUT_OF_DATEAircraft's database version is older than the latest one. User should use DJI Go or Assistant 2 to upgrade the firmware in order to keep the database up to date.
      UP_TO_DATEThe database in the aircraft is up to date.
      UNKNOWNUnknown state
      Class Members:
      enum FlyZoneState
      @EXClassNullAway
      enum FlyZoneState
      Package:dji.common.flightcontroller.flyzone
      Description:

      This enum describes whether the aircraft is clear of, near, or actually in a fly zone.

      Enum Members:
      CLEARThe aircraft is not within 200 meters of any warning, enhanced warning, authorization or restricted zone.
      NEAR_RESTRICTED_ZONEThe aircraft is within 200 meters of an authorization or restricted zone.
      IN_WARNING_ZONE_WITH_HEIGHT_LIMITATIONThe aircraft is currently in a warning or enhanced warning zone and this place will limit max flight height to 120m.
      IN_WARNING_ZONEThe aircraft is currently in a warning or enhanced warning zone.
      IN_RESTRICTED_ZONEThe aircraft is currently in an authorization or restricted zone.
      UNKNOWNUnknown.
      Class Members: