class DJIWaypointMissionOperator
@interface DJIWaypointMissionOperator : NSObject
Header: DJIWaypointMissionOperator.h Inherits From: NSObject
Description:
The waypoint operator is the only object that controls, runs and monitors Waypoint Missions. It can be accessed from DJIMissionControl
.
Class Members:
Preparation
property loadedMission
@property (readonly , nonatomic , nullable ) DJIWaypointMission *loadedMission
Header: DJIWaypointMissionOperator.h
Description:
Gets the currently loaded mission of the operator. There are two ways to load a mission. 1. A mission can be loaded by user through loadMission
. 2. If the aircraft is already executing a waypoint mission when SDK is re-connected, the operator will download part of the mission's information from the aircraft and load it automatically. In that case, the loaded mission will only contain the summary of the executing mission but information for each waypoint is absent. User can call downloadMissionWithCompletion
to get all the information for the loaded mission. The loadedMission
will be reset to nil
when the execution of the loadedMission is stopped, finished or interrupted.
See Also:
DJIWaypointMission
Get Previous Interruption
method
method getPreviousInterruptionWithCompletion
- (void )getPreviousInterruptionWithCompletion:(void (^)(DJIWaypointMissionInterruption *_Nullable interruption, NSError *_Nullable error))completion
Header: DJIWaypointMissionOperator.h
Description:
Gets the interruption of the last waypoint mission. If a waypoint mission is interrupted before the completion, the aircraft will record the interruption information. This information is only available when the last waypoint mission is incomplete and the first waypoint of the mission has been reached. The interruption will also be recorded if the mission is stopped by the user. The interruption information is recorded in the aircraft and the information persists even after the aircraft's reboot.
DJIWaypointMissionInterruption *_Nullable interruption The interruption information to get. Returns NULL if there is any error. NSError *_Nullable error Error retrieving the value. void(^)(DJIWaypointMissionInterruption *_Nullable interruption, NSError *_Nullable error) completion Completion block to receive the result.
Mission Upload to Aircraft
method
Mission Download from Aircraft
method
method downloadMissionWithCompletion
- (void )downloadMissionWithCompletion:(DJICompletionBlock)completion
Header: DJIWaypointMissionOperator.h
Description:
Downloads information of each waypoint from aircraft and save it to loadedMission
. If a download operation is started, the operator will download the information of waypoints missing in loadedMission
one-by-one in ascending order. If loadedMission
is already complete (containing all the waypoints), this method will call completion
immediately without error. It can only be called when the currentState
is one of the following: - DJIWaypointMissionStateExecuting
- DJIWaypointMissionStateExecutionPaused
Mission Execution
method setAutoFlightSpeed:withCompletion
- (void )setAutoFlightSpeed:(float )speed withCompletion:(DJICompletionBlock)completion
Header: DJIWaypointMissionOperator.h
Description:
Set the flight speed while the mission is executing automatically (without manual joystick speed input). This is the only property or method in this class that can communicate with the aircraft during a mission. All other properties and methods are used offline to prepare the mission which is then uploaded to the aircraft.
State
Execution Progress
property
property latestExecutionProgress
@property (readonly , nonatomic , nullable ) DJIWaypointExecutionProgress *latestExecutionProgress
Header: DJIWaypointMissionOperator.h
Description:
The latest execution progress cached by the operator. It will be reset to nil
after loadMission
is called.
See Also:
DJIWaypointExecutionProgress
property currentState
@property (readonly , nonatomic ) DJIWaypointMissionState currentState
Header: DJIWaypointMissionOperator.h
Description:
The current state of the operator.
See Also:
DJIWaypointMissionState
property latestUploadProgress
@property (readonly , nonatomic , nullable ) DJIWaypointUploadProgress *latestUploadProgress
Header: DJIWaypointMissionOperator.h
Description:
The latest execution progress cached by the operator. It will be reset to nil
after loadMission
is called.
See Also:
DJIWaypointUploadProgress
Listener
method addListenerToUploadEvent:withQueue:andBlock
- (void )addListenerToUploadEvent:(id )listener
withQueue:(nullable dispatch_queue_t )queue
andBlock:(DJIWaypointMissionOperatorUploadEventBlock)block
Header: DJIWaypointMissionOperator.h
Description:
Adds listener to receive the event related to upload.
id listener Listener that is interested on upload event. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJIWaypointMissionOperatorUploadEventBlock block Block will be called when there is event updated related to upload.
method addListenerToDownloadEvent:withQueue:andBlock
- (void )addListenerToDownloadEvent:(id )listener
withQueue:(nullable dispatch_queue_t )queue
andBlock:(DJIWaypointMissionOperatorDownloadEventBlock)block
Header: DJIWaypointMissionOperator.h
Description:
Adds listener to receive the event related to download.
id listener Listener that is interested on download event. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJIWaypointMissionOperatorDownloadEventBlock block Block will be called when there is event updated related to download.
method addListenerToStarted:withQueue:andBlock
- (void )addListenerToStarted:(id )listener
withQueue:(nullable dispatch_queue_t )queue
andBlock:(DJIWaypointMissionOperatorSimpleEventBlock)block
Header: DJIWaypointMissionOperator.h
Description:
Adds listener to receive the notification when a waypoint mission is started.
id listener Listener that is interested on the start of waypoint mission. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJIWaypointMissionOperatorSimpleEventBlock block Block will be called when a waypoint mission is started.
method addListenerToExecutionEvent:withQueue:andBlock
- (void )addListenerToExecutionEvent:(id )listener
withQueue:(nullable dispatch_queue_t )queue
andBlock:(DJIWaypointMissionOperatorExecutionEventBlock)block
Header: DJIWaypointMissionOperator.h
Description:
Adds listener to receive the event related to execution.
id listener Listener that is interested on execution event. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJIWaypointMissionOperatorExecutionEventBlock block Block will be called when there is event updated related to execution.
method addListenerToFinished:withQueue:andBlock
- (void )addListenerToFinished:(id )listener
withQueue:(nullable dispatch_queue_t )queue
andBlock:(DJICompletionBlock)block
Header: DJIWaypointMissionOperator.h
Description:
Adds listener to receive the notification when a waypoint mission is finished.
id listener Listener that is interested on the finish of waypoint mission. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJICompletionBlock block Block will be called when a waypoint mission is finished. If the mission is interrupted with an error, the error will be passed to the block.
method removeListener
- (void )removeListener:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener. If the same listener is listening to multiple events and notifications (e.g. upload event and download event), it will not receive any update of them.
id listener Listener to be removed.
method removeAllListeners
- (void )removeAllListeners
Header: DJIWaypointMissionOperator.h
Description:
Remove all listeners.
method removeListenerOfStarted
- (void )removeListenerOfStarted:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener to stop listening to the notification that a mission is started.
id listener Listener to be removed.
method removeListenerOfFinished
- (void )removeListenerOfFinished:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener to stop listening to the notification that a mission is finished.
id listener Listener to be removed.
method removeListenerOfUploadEvents
- (void )removeListenerOfUploadEvents:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener to stop listening to upload events.
id listener Listener to be removed.
method removeListenerOfDownloadEvents
- (void )removeListenerOfDownloadEvents:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener to stop listening to download events.
id listener Listener to be removed.
method removeListenerOfExecutionEvents
- (void )removeListenerOfExecutionEvents:(id )listener
Header: DJIWaypointMissionOperator.h
Description:
Removes listener to stop listening to execution events.
id listener Listener to be removed.
Completion Blocks
typedef block
typedef block DJIWaypointMissionOperatorExecutionEventBlock
typedef void (^DJIWaypointMissionOperatorExecutionEventBlock)(DJIWaypointMissionExecutionEvent *event)
Header: DJIWaypointMissionOperator.h
Description:
Block to receive the updated execution event.
typedef block DJIWaypointMissionOperatorSimpleEventBlock
typedef void (^DJIWaypointMissionOperatorSimpleEventBlock)()
Header: DJIWaypointMissionOperator.h
Description:
Block to receive the notification that a waypoint mission is started successfully.
typedef block DJIWaypointMissionOperatorUploadEventBlock
typedef void (^DJIWaypointMissionOperatorUploadEventBlock)(DJIWaypointMissionUploadEvent *event)
Header: DJIWaypointMissionOperator.h
Description:
Block that receive the updated upload event.
typedef block DJIWaypointMissionOperatorDownloadEventBlock
typedef void (^DJIWaypointMissionOperatorDownloadEventBlock)(DJIWaypointMissionDownloadEvent *event)
Header: DJIWaypointMissionOperator.h
Description:
Block to receive the updated download event.
enum DJIWaypointMissionState
typedef NS_ENUM (NSInteger , DJIWaypointMissionState)
Header: DJIWaypointMissionOperator.h
Description:
All the possible state of DJIWaypointMissionOperator
.
Enum Members:
DJIWaypointMissionStateNotSupportedThe connected product does not support waypoint mission. DJIWaypointMissionStateReadyToUploadThe aircraft is ready to upload a mission. DJIWaypointMissionStateUploadingThe uploading is started successfully. Detail information for each waypoint is being uploaded one by one. DJIWaypointMissionStateReadyToExecuteWaypoint mission is uploaded completely and the aircraft is ready to start the execution. DJIWaypointMissionStateExecutingThe execution is started successfully. DJIWaypointMissionStateExecutionPausedWaypoint mission is paused successfully. User can call resumeMissionWithCompletion
to continue the execution. DJIWaypointMissionStateDisconnectedThe connection between the mobile device, remote controller and aircraft is broken. DJIWaypointMissionStateRecoveringThe connection between the mobile device, remote controller and aircraft is built-up. The operator is synchronizing the state from the aircraft. DJIWaypointMissionStateUnknownThe state of the operator is unknown. It is the initial state when the operator is just created.