DJI Mobile SDK Documentation

      class Simulator

      class Simulator
      Package:dji.sdk.flightcontroller
      Description:

      DJI aircraft can be put into simulation mode using this class. Developers can start and stop the simulation, as well as monitor basic aircraft attitude and location information.

      Class Members:
      State Updates
      method
      method setStateCallback
      void setStateCallback(@Nullable SimulatorState.Callback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.SIMULATOR_STATE
      Description:

      Sets the callback function that updates the state data received from an aircraft in simulation mode.

      Input Parameters:
      @Nullable SimulatorState.Callback callbackThe execution callback with the execution result returned.
      Simulator Control
      method
      method isSimulatorActive
      boolean isSimulatorActive()
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.IS_SIMULATOR_ACTIVE
      Description:

      true if the simulator is started.

      Return:
      booleanA boolean value.
      method
      method start
      void start(@NonNull final InitializationData data, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.START_SIMULATOR
      Description:

      Start simulator. Will result in error if simulation is already started.

      Input Parameters:
      @NonNull final InitializationData dataThe data with which to initialize the simulator.
      @Nullable final CompletionCallback callbackThe execution callback with the execution result returned.
      method
      method stop
      void stop(@Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.STOP_SIMULATOR
      Description:

      Stop the simulator.

      Input Parameters:
      @Nullable final CompletionCallback callbackThe execution callback with the execution result returned.
      method setFlyZoneLimitationEnabled
      void setFlyZoneLimitationEnabled(boolean enabled, @Nullable final CompletionCallback callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.FLY_ZONE_LIMITATION_ENABLED
      Description:

      Enable/disable the fly zone system in the simulator. By default, fly zone is disabled in the simulator. Rebooting the aircraft is required for the settings to take effect.

      Input Parameters:
      boolean enabledtrue to enable fly zone in the simulator.
      @Nullable final CompletionCallback callbackThe execution callback with the returned value(s).
      method getFlyZoneLimitationEnabled
      void getFlyZoneLimitationEnabled(@NonNull final CompletionCallbackWith<Boolean> callback)
      Package:dji.sdk.flightcontroller
      SDK Key:FlightControllerKey.FLY_ZONE_LIMITATION_ENABLED
      Description:

      Gets fly zone system simulator status (enabled/disabled). By default, fly zone is disabled in the simulator.

      Input Parameters:
      @NonNull final CompletionCallbackWith<Boolean> callbackThe execution callback with the returned value(s).