DJI Mobile SDK Documentation

      class DJISimulator

      @interface DJISimulator : NSObject
      Header:DJISimulator.h
      Inherits From:NSObject
      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
      property
      property delegate
      @property(nonatomic, weak) id<DJISimulatorDelegate> delegate
      Header:DJISimulator.h
      Description:

      Returns the delegate of simulator.

      See Also:

      DJISimulatorDelegate

      Simulator Control
      property
      property isSimulatorActive
      @property(nonatomic, readonly) BOOL isSimulatorActive
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsSimulatorActive
      Description:

      YES if the simulator is started.

      method startWithLocation:updateFrequency:GPSSatellitesNumber:withCompletion
      - (void)startWithLocation:(CLLocationCoordinate2D)location
      updateFrequency:(NSUInteger)frequency
      GPSSatellitesNumber:(NSUInteger)number
      withCompletion:(DJICompletionBlock)completion
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamStartSimulator
      Description:

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

      Input Parameters:
      CLLocationCoordinate2D locationSimulator coordinate latitude and longitude, in degrees.
      NSUInteger frequencyAircraft simulator state push frequency, in Hz, with range [2, 150]. A setting of 10 Hz will result in delegate method being called, 10 times per second.
      NSUInteger numberThe initial number of GPS satellites with range [0, 20].
      DJICompletionBlock completionThe completion block.
      method stopWithCompletion
      - (void)stopWithCompletion:(DJICompletionBlock)completion
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamStopSimulator
      Description:

      Stop the simulator.

      Input Parameters:
      DJICompletionBlock completionThe Completion block.
      method setFlyZoneLimitationEnabled:withCompletion
      - (void)setFlyZoneLimitationEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)completion
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamSimulatorFlyZoneLimitationEnabled
      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:
      BOOL enabledYES to enable fly zone in the simulator.
      DJICompletionBlock completionCompletion block to receive the result.
      method getFlyZoneLimitationEnabledWithCompletion
      - (void)getFlyZoneLimitationEnabledWithCompletion:(void(^)(BOOL enabled, NSError *_Nullable error))block
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamSimulatorFlyZoneLimitationEnabled
      Description:

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

      Input Parameters:
      BOOL enabledYES if the fly zone system is enabled.
      NSError *_Nullable errorError retrieving the value.
      void(^)(BOOL enabled, NSError *_Nullable error) blockCompletion block to receive the result.
      method setWindSpeed:withCompletion
      - (void)setWindSpeed:(DJISimulatorWindSpeed *)windSpeed withCompletion:(DJICompletionBlock)completion
      Header:DJISimulator.h
      Description:

      Set simulator wind speed.

      Input Parameters:
      DJISimulatorWindSpeed * windSpeedSimulator Wind Speed.
      DJICompletionBlock completionCompletion block to receive the result.
      method getWindSpeedWithCompletion
      - (void)getWindSpeedWithCompletion:(void(^)(DJISimulatorWindSpeed *_Nullable windSpeed, NSError *_Nullable error))completion
      Header:DJISimulator.h
      Description:

      Get simulator wind speed.

      Input Parameters:
      DJISimulatorWindSpeed *_Nullable windSpeedSimulator Wind Speed.
      NSError *_Nullable errorError retrieving the value.
      void(^)(DJISimulatorWindSpeed *_Nullable windSpeed, NSError *_Nullable error) completionCompletion block to receive the result.
      protocol DJISimulatorDelegate
      @protocol DJISimulatorDelegate <NSObject>
      Header:DJISimulator.h
      Inherits From:NSObject
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamSimulatorState
      Description:

      This protocol provides the delegate method of the simulator.

      Protocol Methods:

      Protocol Method

      method simulator:didUpdateState
      @optional
      - (void)simulator:(DJISimulator *_Nonnull)simulator didUpdateState:(DJISimulatorState *_Nonnull)state
      Header:DJISimulator.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamSimulatorState
      Description:

      Updates the simulator's current state.

      Input Parameters:
      DJISimulator *_Nonnull simulatorAn instance of DJISimulator.
      DJISimulatorState *_Nonnull stateAn instance of DJISimulatorState.