DJIMissionManager
@interface DJIMissionManager : NSObject
This class manages the execution cycle for a mission. To execute a mission,
you must normally first invoke prepareMission:withProgress:withCompletion
to prepare the mission. Then call startMissionExecutionWithCompletion:
to
start the prepared mission. You can also pause, resume or stop an executing
mission if the mission supports the operation.
-
Returns the DJIMissionManager delegate.
Declaration
Objective-C
@property (readwrite, nonatomic) id<DJIMissionManagerDelegate> _Nullable delegate;
-
YES if the mission is ready to be executed. It is ready when the
prepareMission
method completes successfully.Declaration
Objective-C
@property (readonly, nonatomic) BOOL isMissionReadyToExecute;
-
Returns the instance of DJIMissionManager.
Declaration
Objective-C
+ (DJIMissionManager *_Nullable)sharedInstance;
-
Prepares the mission for execution. For the waypoint mission, data must be uploaded to the aircraft (product), and the
DJIMissionProgressHandler
can be used to monitor upload progress. The follow-me, panorama, hotpoint and custom missions require much less time for the preparation phase.PrepareMission
fails if a mission is currently executing.Declaration
Objective-C
- (void)prepareMission:(DJIMission *_Nonnull)mission withProgress:(DJIMissionProgressHandler)preparationProgress withCompletion:(DJICompletionBlock)completion;
Parameters
mission
Mission object
preparationProgress
Progress handler callback method to monitor preparation progress
completion
Completion block.
-
Downloads the current mission configuration data from aircraft. This method should only be called after a mission has been started. Only waypoint missions and hot point missions can be downloaded from the aircraft.
Declaration
Objective-C
- (void)downloadMissionWithProgress:(DJIMissionProgressHandler)downladProgress withCompletion: (DJIMissionDownloadCompletionBlock)completion;
Parameters
downloadProgress
Progress handler callback method to monitor download progress.
completion
Completion block.
-
Starts mission execution. This method should only be called after
prepareMission
was successfully called. For a waypoint mission, if the aircraft is not flying, it will automatically take off and execute the mission. For a hot point or follow me mission, the aircraft must be flying before the mission is started. For a custom mission, the behavior depends on the first mission step.Declaration
Objective-C
- (void)startMissionExecutionWithCompletion:(DJICompletionBlock)completion;
Parameters
completion
Completion block.
-
Pauses the current mission being executed. The aircraft will hover in its current location. The current state will be saved until
resumeMissionExecutionWithCompletion
is called. Returns a system busy error if theMissionManager
is uploading or downloading the mission.Declaration
Objective-C
- (void)pauseMissionExecutionWithCompletion:(DJICompletionBlock)completion;
Parameters
completion
Completion block.
-
Resumes the currently paused mission. Returns a system busy error if the
MissionManager
is uploading or downloading the mission.Declaration
Objective-C
- (void)resumeMissionExecutionWithCompletion:(DJICompletionBlock)completion;
Parameters
completion
Completion block.
-
Stops the current mission. The aircraft will hover in its current location. Returns a system busy error if the
MissionManager
is uploading or downloading the mission.Declaration
Objective-C
- (void)stopMissionExecutionWithCompletion:(DJICompletionBlock)completion;
Parameters
completion
Completion block.
-
Returns the current executing mission. This method should only be called after the mission has started execution.
Declaration
Objective-C
- (DJIMission *_Nullable)currentExecutingMission;
Return Value
Mission object for the current mission.