class DJIWaypointV2MissionOperator
@interface DJIWaypointV2MissionOperator : NSObject
Header: DJIWaypointV2MissionOperator.h Inherits From: NSObject
Description:
The waypoint operator is the only object that controls, runs and monitors Waypoint V2 Missions. It can be accessed from DJIMissionControl
.
Class Members:
enum DJIWaypointV2MissionState
typedef NS_ENUM (NSInteger , DJIWaypointV2MissionState)
Header: DJIWaypointV2MissionOperator.h
Description:
All the possible state of DJIWaypointV2MissionOperator
.
Enum Members:
DJIWaypointV2MissionStateUnknownThe state of the operator is unknown. DJIWaypointV2MissionStateDisconnectedThe connection between the mobile device, remote controller and aircraft is broken. DJIWaypointV2MissionStateRecoveringThe connection between the mobile device, remote controller and aircraft is built-up. The operator is synchronizing the state from the aircraft. DJIWaypointV2MissionStateNotSupportedThe connected product does not support waypoint mission 2.0. DJIWaypointV2MissionStateReadyToUploadThe aircraft is ready to upload a mission. DJIWaypointV2MissionStateUploadingThe uploading is started successfully. Detail information for each waypoint is being uploaded one by one. DJIWaypointV2MissionStateReadyToExecuteWaypoint mission is uploaded completely and the aircraft is ready to start the execution. DJIWaypointV2MissionStateExecutingThe execution is started successfully. DJIWaypointV2MissionStateInterruptedWaypoint mission is paused successfully. User can call interruptMissionWithCompletion
to continue the execution.
enum DJIWaypointV2MissionActionState
typedef NS_ENUM (NSInteger , DJIWaypointV2MissionActionState)
Header: DJIWaypointV2MissionOperator.h
Description:
All the possible action state of DJIWaypointV2MissionOperator
.
Enum Members:
DJIWaypointV2MissionActionStateUnknownThe state of the operator is unknown. It is the initial action state when the operator is just created. DJIWaypointV2MissionActionStateDisconnectedThe connection between the mobile device, remote controller and aircraft is broken. DJIWaypointV2MissionActionStateRecoveringThe connection between the mobile device, remote controller and aircraft is built-up. The operator is synchronizing the action state from the aircraft. DJIWaypointV2MissionActionStateNotSupportedThe connected product does not support waypoint mission 2.0. DJIWaypointV2MissionActionStateReadyToUploadThe aircraft is ready to upload actions. DJIWaypointV2MissionActionStateUploadingThe uploading is started successfully. Detail information for each action is being uploaded one by one. DJIWaypointV2MissionActionStateReadyToExecuteWaypoint mission is uploaded completely and the aircraft is ready to start the execution. DJIWaypointV2MissionActionStateExecutingThe execution is started successfully. DJIWaypointV2MissionActionStateInterruptedWaypoint mission is interrupted successfully. User can call interruptMissionWithCompletion
to continue the execution.
enum DJIWaypointV2InterruptRecoverAction
typedef NS_ENUM (NSInteger , DJIWaypointV2InterruptRecoverAction)
Header: DJIWaypointV2MissionTypes.h
Description:
Determines the recover mission flying to which point. call recoverMissionWithCompletion
to recover mission. The waypoint mission is interrupted by invoking interruptMissionWithCompletion
. The waypoint mission is interrupted by moving remote controller's joystick. Other interruption such as obstacle avoidance.
Enum Members:
DJIWaypointV2InterruptRecoverActionGoBackToRecordedPointWhen the mission is recovered, the aircraft flying to the recorded point. DJIWaypointV2InterruptRecoverActionGoBackToNextWaypointWhen the mission is recovered, the aircraft flying to next waypoint. DJIWaypointV2InterruptRecoverActionGoBackToNextTwoWaypointWhen the mission is recovered, the aircraft will fly to the waypoint next to the next waypoint.
enum DJIWaypointV2MissionRCLostAction
typedef NS_ENUM (NSInteger , DJIWaypointV2MissionRCLostAction)
Header: DJIWaypointV2MissionTypes.h
Description:
The action of waypoint mission that will be executed when the remote controller signal lost.
Enum Members:
DJIWaypointV2MissionRCLostActionStopMissionStops current mission when the remote controller signal is lost. DJIWaypointV2MissionRCLostActionContinueContinues the mission when the remote controller signal is lost.
enum DJIWaypointV2MissionFinishedAction
typedef NS_ENUM (uint8_t, DJIWaypointV2MissionFinishedAction)
Header: DJIWaypointV2MissionTypes.h
Description:
Actions will be taken when the waypoint mission is finished.
Enum Members:
DJIWaypointV2MissionFinishedActionNoActionNo further action will be taken. The aircraft can be controlled by the remote controller. DJIWaypointV2MissionFinishedActionGoHomeGoes home when the mission is finished. The aircraft will land directly if it is within 20 meters away from the home point. DJIWaypointV2MissionFinishedActionAutoLandingThe aircraft will land automatically at the last waypoint. DJIWaypointV2MissionFinishedActionGoToFirstWaypointThe aircraft will go back to the first waypoint and hover. DJIWaypointV2MissionFinishedActionContinueUntilStopWhen the aircraft reaches its final waypoint, it will hover without ending the mission. The joystick can still be used to pull the aircraft back along its previous waypoints. The only way this mission can end is if stopMission is called. DJIWaypointV2MissionFinishedActionUnknownUnknow finished action.
Completion Blocks
typedef block
typedef block DJIWaypointV2MissionOperatorActionUploadEventBlock
typedef void (^DJIWaypointV2MissionOperatorActionUploadEventBlock)(DJIWaypointV2MissionActionUploadEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block that receive the actions updated upload event.
typedef block DJIWaypointV2MissionOperatorActionDownloadEventBlock
typedef void (^DJIWaypointV2MissionOperatorActionDownloadEventBlock)(DJIWaypointV2MissionActionDownloadEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block to receive the updated download event.
typedef block DJIWaypointV2MissionOperatorActionExecutionEventBlock
typedef void (^DJIWaypointV2MissionOperatorActionExecutionEventBlock)(DJIWaypointV2MissionActionExecutionEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block to receive the updated execution event.
typedef block DJIWaypointV2MissionOperatorExecutionEventBlock
typedef void (^DJIWaypointV2MissionOperatorExecutionEventBlock)(DJIWaypointV2MissionExecutionEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block to receive the updated execution event.
typedef block DJIWaypointV2MissionOperatorSimpleEventBlock
typedef void (^DJIWaypointV2MissionOperatorSimpleEventBlock)(void )
Header: DJIWaypointV2MissionOperator.h
Description:
Block to receive the notification that a waypoint mission is started successfully.
typedef block DJIWaypointV2MissionOperatorUploadEventBlock
typedef void (^DJIWaypointV2MissionOperatorUploadEventBlock)(DJIWaypointV2MissionUploadEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block that receive the updated upload event.
typedef block DJIWaypointV2MissionOperatorDownloadEventBlock
typedef void (^DJIWaypointV2MissionOperatorDownloadEventBlock)(DJIWaypointV2MissionDownloadEvent *event)
Header: DJIWaypointV2MissionOperator.h
Description:
Block to receive the updated download event.
Mission Action Execution Event
class
Mission Action Download Event
class
Mission Action Upload Event
class
Mission Execution Event
class
Mission Download Event
class
Mission Upload Event
class
Preparation
property loadedMission
@property (readonly , nonatomic , nullable ) DJIWaypointV2Mission *loadedMission
Header: DJIWaypointV2MissionOperator.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:withCompletion
. 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.
See Also:
DJIWaypointV2Mission
Loaded Action Count
property
property loadedActionCount
@property (readonly , nonatomic ) NSUInteger loadedActionCount
Header: DJIWaypointV2MissionOperator.h
Description:
Gets the currently loaded actions count of the operator. There are two ways to load a mission. 1. Actions can be loaded by user through loadMission:withCompletion
. 2. If the aircraft is already executing a waypoint mission and it has uploaded actions when SDK is re-connected, the operator will recover uploaded action count.
property loadedActions
@property (readonly , nonatomic ) NSArray <DJIWaypointV2Action *>* loadedActions
Header: DJIWaypointV2MissionOperator.h
Description:
Gets the count of loaded actions in current operator. There are two ways to load a mission. 1. Actions can be loaded by user through loadMission:withCompletion
. 2. If the aircraft is already executing a waypoint mission and it has uploaded actions when SDK is re-connected, the operator will recover uploaded action count. load it automatically. In that case, the loaded actions will be nil
, if user want get summary of the executing actions user can call downloadMissionWithCompletion
to get all the information for the loaded actions. The loadedActions
will be reset to nil
when the execution of the getLoadedMission is stopped, finished.
See Also:
DJIWaypointV2Action
property currentState
@property (readonly , nonatomic ) DJIWaypointV2MissionState currentState
Header: DJIWaypointV2MissionOperator.h
Description:
The current state of the operator.
See Also:
DJIWaypointV2MissionState
Current Action State
property
property currentActionState
@property (readonly , nonatomic ) DJIWaypointV2MissionActionState currentActionState
Header: DJIWaypointV2MissionOperator.h
Description:
The current action state of the operator.
See Also:
DJIWaypointV2MissionActionState
Upload Waypoint Actions
method
method uploadWaypointActions:withCompletion
- (void )uploadWaypointActions:(NSArray *)actions withCompletion:(DJICompletionBlock)completion
Header: DJIWaypointV2MissionOperator.h
Description:
Starts to upload the loadedActions
to the aircraft. It can only be called when the loadedActions
is complete and the currentState
is DJIWaypointV2MissionStateReadyToExecute
. If a timeout error occurs during the previous upload, the upload operation will resume from the previous break-point. After a mission is uploaded successfully, the DJIWaypointV2MissionActionState
will become DJIWaypointV2MissionActionStateReadyToExecute
.
method downloadMissionWithCompletion
- (void )downloadMissionWithCompletion:(DJICompletionBlock)completion
Header: DJIWaypointV2MissionOperator.h
Description:
Downloads information of each waypoint from aircraft and save it to loadedMission
. If a download operation starts, the operator will download the information of waypoints missing in loadedMission
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: - DJIWaypointV2MissionActionStateExecuting
- DJIWaypointV2MissionStateInterrupted
method downloadActionsWithCompletion
- (void )downloadActionsWithCompletion:(DJICompletionBlock)completion
Header: DJIWaypointV2MissionOperator.h
Description:
Downloads information of each waypoint from aircraft and save it to loadedMission
. If a download operation starts, 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: - DJIWaypointV2MissionActionStateExecuting
- DJIWaypointV2MissionStateInterrupted
.
Listener
Add to Upload Event
method
method addListenerToUploadEvent:withQueue:andBlock
- (void )addListenerToUploadEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorUploadEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorUploadEventBlock block Block will be called when there is event updated related to upload.
Add to Download Event
method
method addListenerToDownloadEvent:withQueue:andBlock
- (void )addListenerToDownloadEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorDownloadEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorDownloadEventBlock 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:(DJIWaypointV2MissionOperatorSimpleEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorSimpleEventBlock block Block will be called when a waypoint mission is started.
Add to Execution Event
method
method addListenerToExecutionEvent:withQueue:andBlock
- (void )addListenerToExecutionEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorExecutionEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorExecutionEventBlock block Block will be called when there is event updated related to execution.
Add to Action Upload Event
method
method addListenerToActionUploadEvent:withQueue:andBlock
- (void )addListenerToActionUploadEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorActionUploadEventBlock)block
Header: DJIWaypointV2MissionOperator.h
Description:
Adds listener to receive the event related to action upload.
id listener Listener that is interested on upload event. nullable dispatch_queue_t queue The dispatch queue that block
will be called on. DJIWaypointV2MissionOperatorActionUploadEventBlock block Block will be called when there is event updated related to upload.
Add to Action Download Event
method
method addListenerToActionDownloadEvent:withQueue:andBlock
- (void )addListenerToActionDownloadEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorActionDownloadEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorActionDownloadEventBlock block Block will be called when there is event updated related to download.
Add to Action Execution Event
method
method addListenerToActionExecutionEvent:withQueue:andBlock
- (void )addListenerToActionExecutionEvent:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJIWaypointV2MissionOperatorActionExecutionEventBlock)block
Header: DJIWaypointV2MissionOperator.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. DJIWaypointV2MissionOperatorActionExecutionEventBlock block Block will be called when there is an event updated related to execution.
method addListenerToFinished:withQueue:andBlock
- (void )addListenerToFinished:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJICompletionBlock)block
Header: DJIWaypointV2MissionOperator.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 addListenerToStopped:withQueue:andBlock
- (void )addListenerToStopped:(id )listener withQueue:(nullable dispatch_queue_t )queue andBlock:(DJICompletionBlock)block
Header: DJIWaypointV2MissionOperator.h
Description:
Adds listener to receive the notification when a waypoint mission is stopped by the user.
id listener Listener that is interested on the stop 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 stopped by the user.
method removeListener
- (void )removeListener:(id )listener
Header: DJIWaypointV2MissionOperator.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: DJIWaypointV2MissionOperator.h
Description:
Remove all listeners.
method removeListenerOfStarted
- (void )removeListenerOfStarted:(id )listener
Header: DJIWaypointV2MissionOperator.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: DJIWaypointV2MissionOperator.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: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to upload events.
id listener Listener to be removed.
method removeListenerOfDownloadEvents
- (void )removeListenerOfDownloadEvents:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to download events.
id listener Listener to be removed.
method removeListenerOfExecutionEvents
- (void )removeListenerOfExecutionEvents:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to execution events.
id listener Listener to be removed.
method removeListenerOfActionUploadEvents
- (void )removeListenerOfActionUploadEvents:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to action upload events.
id listener Listener to be removed.
method removeListenerOfActionDownloadEvents
- (void )removeListenerOfActionDownloadEvents:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to action download events.
id listener Listener to be removed.
method removeListenerOfActionExecutionEvents
- (void )removeListenerOfActionExecutionEvents:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to action execution events.
id listener Listener to be removed.
method removeListenerOfStopped
- (void )removeListenerOfStopped:(id )listener
Header: DJIWaypointV2MissionOperator.h
Description:
Removes listener to stop listening to the notification that a mission is stopped by the user.
id listener Listener to be stopped.
Mission Execution