public class

DJIMissionManager

extends DJIBaseComponent
java.lang.Object
   ↳ dji.sdk.base.DJIBaseComponent
     ↳ dji.sdk.missionmanager.DJIMissionManager

Class Overview

This class manages the execution cycle for a mission. To execute a mission, normally the user must first invoke prepareMission() to prepare the mission. Then the user can call startMissionExecution() to start the prepared mission. The user can also pause, resume, or stop an executing mission if the mission supports the operation.

Summary

Nested Classes
interface DJIMissionManager.MissionProgressStatusCallback This interface provides the method to update mission progress status. 
Fields
public boolean isMissionReadyToExecute This field is deprecated. This property will be deleted in the coming version.
public boolean mIsCustomMissionExecuting
Public Methods
static boolean checkValidGPSCoordinate(double homeLat, double homeLng)
void downloadMission(DJIMission.DJIMissionProgressHandler downloadProgress, DJICompletionCallbackWith<DJIMission> callback)
Downloads the current mission configuration data from aircraft.
DJIMission getCurrentExecutingMission()
Returns current executing mission.
static DJIMissionManagerError getDJIErrorByCode(int code)
DJICommonCallbacks.DJICompletionCallback getFinishedCallback()
void invokeFinishCallback(DJIError error)
boolean isConnected()
true if the mission manager is connected.
synchronized static void onDestroy()
void pauseMissionExecution(DJICommonCallbacks.DJICompletionCallback callback)
Pauses the current mission being executed.
void prepareMission(DJIMission mission, DJIMission.DJIMissionProgressHandler progressHandler, DJICommonCallbacks.DJICompletionCallback callback)
Prepares the mission for execution.
void removeMissionManagerEventListener(DJIMissionManagerEventListener listener)
void resumeMissionExecution(DJICommonCallbacks.DJICompletionCallback callback)
Resumes the currently paused mission.
void setCurrentExecutingMission(DJIMission mCurrentExecutingMission)
void setInternalCallback(DJICommonCallbacks.DJICompletionCallback internalCallback)
static void setMissionExecutionEnable(boolean enable, DJICommonCallbacks.DJICompletionCallback callback)
void setMissionExecutionFinishedCallback(DJICommonCallbacks.DJICompletionCallback callback)
Set up the Mission Execution Finished Callback.
void setMissionManagerEventListener(DJIMissionManagerEventListener listener)
void setMissionProgressStatusCallback(DJIMissionManager.MissionProgressStatusCallback missionProgressStatusCallback)
Set up the Mission Progress Status Callback.
void startMissionExecution(DJICommonCallbacks.DJICompletionCallback callback)
Starts mission execution.
void stopMissionExecution(DJICommonCallbacks.DJICompletionCallback callback)
Stops the current mission.
[Expand]
Inherited Methods
From class dji.sdk.base.DJIBaseComponent
From class java.lang.Object

Fields

public boolean isMissionReadyToExecute

This field is deprecated.
This property will be deleted in the coming version.

public boolean mIsCustomMissionExecuting

Public Methods

public static boolean checkValidGPSCoordinate (double homeLat, double homeLng)

public void downloadMission (DJIMission.DJIMissionProgressHandler downloadProgress, DJICompletionCallbackWith<DJIMission> callback)

Downloads the current mission configuration data from aircraft. This method should only be called after a mission has been prepared. Only waypoint missions and hot point missions can be downloaded from the aircraft.

Parameters
downloadProgress Progress handler callback method to monitor download progress.
callback The execution callback with the returned execution result.

public DJIMission getCurrentExecutingMission ()

Returns current executing mission. This method is should only be called after the mission has started execution.

public static DJIMissionManagerError getDJIErrorByCode (int code)

public DJICommonCallbacks.DJICompletionCallback getFinishedCallback ()

public void invokeFinishCallback (DJIError error)

public boolean isConnected ()

true if the mission manager is connected.

public static synchronized void onDestroy ()

public void pauseMissionExecution (DJICommonCallbacks.DJICompletionCallback callback)

Pauses the current mission being executed. The aircraft will hover in its current location. The current state will be saved until resumeMissionExecution() is called. Returns a system busy error if the MissionManager is uploading or downloading the mission.

Parameters
callback The execution callback with the returned execution result.

public void prepareMission (DJIMission mission, DJIMission.DJIMissionProgressHandler progressHandler, DJICommonCallbacks.DJICompletionCallback callback)

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 shorter time for the preparation phase. PrepareMission should fail if a mission is currently executing.

Parameters
mission Mission object.
progressHandler Progress handler callback method to monitor preparation progress.
callback The execution callback with the returned execution result.

public void removeMissionManagerEventListener (DJIMissionManagerEventListener listener)

public void resumeMissionExecution (DJICommonCallbacks.DJICompletionCallback callback)

Resumes the currently paused mission. Returns a system busy error if the MissionManager is uploading or downloading the mission.

Parameters
callback The execution callback with the returned execution result.

public void setCurrentExecutingMission (DJIMission mCurrentExecutingMission)

public void setInternalCallback (DJICommonCallbacks.DJICompletionCallback internalCallback)

public static void setMissionExecutionEnable (boolean enable, DJICommonCallbacks.DJICompletionCallback callback)

public void setMissionExecutionFinishedCallback (DJICommonCallbacks.DJICompletionCallback callback)

Set up the Mission Execution Finished Callback.

public void setMissionManagerEventListener (DJIMissionManagerEventListener listener)

public void setMissionProgressStatusCallback (DJIMissionManager.MissionProgressStatusCallback missionProgressStatusCallback)

Set up the Mission Progress Status Callback.

public void startMissionExecution (DJICommonCallbacks.DJICompletionCallback callback)

Starts mission execution. This should only be called after prepareMission is successfully called. For a waypoint mission, if the aircraft isn't flying, it will automatically take off and execute the mission. For hot point and follow me mission, the aircraft needs to be flying before the mission is started. For a custom mission, the behaviour depends on the first mission step.

Parameters
callback The execution callback with the returned execution result.

public void stopMissionExecution (DJICommonCallbacks.DJICompletionCallback callback)

Stops the current mission. The aircraft will hover in place. Returns a system busy error if the MissionManager is uploading or downloading the mission.

Parameters
callback The execution callback with the returned execution result.