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:
property delegate
@property (nonatomic , weak ) id <DJISimulatorDelegate> delegate
Description:
Returns the delegate of simulator.
See Also:
DJISimulatorDelegate
Simulator Control
property
property isSimulatorActive
@property (nonatomic , readonly ) BOOL isSimulatorActive
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
Description:
Start simulator. Will result in error if simulation is already started.
CLLocationCoordinate2D location Simulator coordinate latitude and longitude, in degrees. NSUInteger 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. NSUInteger number The initial number of GPS satellites with range [0, 20]. DJICompletionBlock completion The completion block.
method stopWithCompletion
- (void )stopWithCompletion:(DJICompletionBlock)completion
Description:
Stop the simulator.
method setFlyZoneLimitationEnabled:withCompletion
- (void )setFlyZoneLimitationEnabled:(BOOL )enabled withCompletion:(DJICompletionBlock)completion
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.
BOOL enabled YES
to enable fly zone in the simulator.DJICompletionBlock completion Completion block to receive the result.
method getFlyZoneLimitationEnabledWithCompletion
- (void )getFlyZoneLimitationEnabledWithCompletion:(void (^)(BOOL enabled, NSError *_Nullable error))block
Description:
Gets fly zone system simulator status (enabled/disabled). By default, fly zone is disabled in the simulator.
BOOL enabled YES if the fly zone system is enabled. NSError *_Nullable error Error retrieving the value. void(^)(BOOL enabled, NSError *_Nullable error) block Completion block to receive the result.
method setWindSpeed:withCompletion
- (void )setWindSpeed:(DJISimulatorWindSpeed *)windSpeed withCompletion:(DJICompletionBlock)completion
Description:
Set simulator wind speed.
method getWindSpeedWithCompletion
- (void )getWindSpeedWithCompletion:(void (^)(DJISimulatorWindSpeed *_Nullable windSpeed, NSError *_Nullable error))completion
Description:
Get simulator wind speed.
DJISimulatorWindSpeed *_Nullable windSpeed Simulator Wind Speed. NSError *_Nullable error Error retrieving the value. void(^)(DJISimulatorWindSpeed *_Nullable windSpeed, NSError *_Nullable error) completion Completion block to receive the result.
protocol DJISimulatorDelegate
@protocol DJISimulatorDelegate <NSObject >
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
Description:
Updates the simulator's current state.