DJISimulator

@interface DJISimulator : NSObject

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.

  • Returns the delegate of simulator.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<DJISimulatorDelegate> _Nullable delegate;
  • YES if the simulator is started.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isSimulatorStarted;
  • Start simulator. Will result in error if simulation is already started.

    Declaration

    Objective-C

    - (void)startSimulatorWithLocation:(CLLocationCoordinate2D)location
                       updateFrequency:(NSUInteger)frequency
                   GPSSatellitesNumber:(NSUInteger)number
                        withCompletion:(DJICompletionBlock)block;

    Parameters

    location

    Simulator coordinate latitude and longitude in degrees.

    frequency

    Aircraft 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.

    number

    The initial number of GPS satellites with range [0, 20].

    block

    The completion block.

  • Stop the simulator.

    Declaration

    Objective-C

    - (void)stopSimulatorWithCompletion:(DJICompletionBlock)block;

    Parameters

    block

    The Completion block.

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

    Declaration

    Objective-C

    - (void)setFlyZoneEnabled:(BOOL)enabled
               withCompletion:(DJICompletionBlock)block;

    Parameters

    enabled

    YES to enable the fly zone in the simulator.

    block

    The execution block with the returned execution result.

  • Gets if the fly zone system is enabled in the simulator. By default, fly zone is disabled in the simulator.

    Declaration

    Objective-C

    - (void)getFlyZoneEnabledWithCompletion:
        (nonnull void (^)(BOOL, NSError *_Nullable))block;

    Parameters

    block

    The execution callback with the returned value.