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; -
YESif 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
locationSimulator coordinate latitude and longitude in degrees.
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.
numberThe initial number of GPS satellites with range [0, 20].
blockThe completion block.
-
Stop the simulator.
Declaration
Objective-C
- (void)stopSimulatorWithCompletion:(DJICompletionBlock)block;Parameters
blockThe 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
enabledYESto enable the fly zone in the simulator.blockThe 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
blockThe execution callback with the returned value.
View on GitHub
DJISimulator Class Reference