DJI Mobile SDK Documentation

      class WaypointV2MissionOperator

      interface WaypointV2MissionOperator
      Package:dji.sdk.mission.waypoint
      Description:

      The waypoint operator is the only object that controls, runs and monitors Waypoint V2 Missions. It can be accessed from MissionControl.

      Class Members:
      enum WaypointV2MissionState
      enum WaypointV2MissionState
      Package:dji.common.mission.waypointv2
      Description:

      All the possible state of WaypointV2MissionOperator.

      Enum Members:
      UNKNOWNThe state of the operator is unknown.
      DISCONNECTEDThe connection between the mobile device, remote controller and aircraft is broken.
      RECOVERINGThe connection between the mobile device, remote controller and aircraft is built-up. The operator is synchronizing the state from the aircraft.
      NOT_SUPPORTEDThe connected product does not support waypoint mission 2.0.
      READY_TO_UPLOADThe aircraft is ready to upload a mission.
      UPLOADINGThe uploading is started successfully. Detail information for each waypoint is being uploaded one by one.
      READY_TO_EXECUTEWaypoint mission is uploaded completely and the aircraft is ready to start the execution.
      EXECUTINGThe execution is started successfully.
      INTERRUPTEDWaypoint mission is paused successfully. User can call interruptMission to continue the execution.
      Class Members:
      enum ActionState
      enum ActionState
      Package:dji.common.mission.waypointv2.Action
      Description:

      All the possible action state of WaypointV2MissionOperator.

      Enum Members:
      UNKNOWNThe state of the operator is unknown. It is the initial action state when the operator is just created.
      DISCONNECTEDThe connection between the mobile device, remote controller and aircraft is broken.
      RECOVERINGThe connection between the mobile device, remote controller and aircraft is built-up. The operator is synchronizing the action state from the aircraft.
      NOT_SUPPORTEDThe connected product does not support waypoint mission 2.0.
      READY_TO_UPLOADThe aircraft is ready to upload actions.
      UPLOADINGThe uploading is started successfully. Detail information for each action is being uploaded one by one.
      READY_TO_EXECUTEWaypoint mission is uploaded completely and the aircraft is ready to start the execution.
      ExecutingThe execution is started successfully.
      InterruptedWaypoint mission is interrupted successfully. User can call interruptMission to continue the execution.
      Class Members:
      enum InterruptRecoverActionType
      enum InterruptRecoverActionType
      Package:dji.common.mission.waypointv2.Action
      Description:

      Determines the recover mission flying to which point. call recoverMission to recover mission. The waypoint mission is interrupted by invoking interruptMission. The waypoint mission is interrupted by moving remote controller's joystick. Other interruption such as obstacle avoidance.

      Enum Members:
      GoBackToRecordPointWhen the mission is recovered, the aircraft flying to the recorded point.
      GoBackToNextPointWhen the mission is recovered, the aircraft flying to next waypoint.
      Class Members:
      enum MissionFinishedAction
      enum MissionFinishedAction
      Package:dji.common.mission.waypointv2
      Description:

      Actions will be taken when the waypoint mission is finished.

      Enum Members:
      NO_ACTIONNo further action will be taken. The aircraft can be controlled by the remote controller.
      GO_HOMEGoes home when the mission is finished. The aircraft will land directly if it is within 20 meters away from the home point.
      AUTO_LANDThe aircraft will land automatically at the last waypoint.
      GO_FIRST_WAYPOINTThe aircraft will go back to the first waypoint and hover.
      CONTINUE_UNTIL_STOPWhen 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.
      Class Members:
      Mission Execution Event
      class
      Mission Download Event
      class
      Mission Upload Event
      class
      Waypoint Action
      class


      Preparation

      Loaded Mission
      method
      method getLoadedMission
      @Nullable
      WaypointV2Mission getLoadedMission()
      Package:dji.sdk.mission.waypoint
      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 downloadMission to get all the information for the loaded mission. The getLoadedMission will be reset to null when the execution of the loadedMission is stopped, finished.

      Return:
      WaypointV2MissionAn object of WaypointV2Mission.
      Load Mission
      method
      method loadMission
      void loadMission(@NonNull WaypointV2Mission mission, @Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Loads a waypoint mission into the operator. A mission can be loaded only when the WaypointV2MissionState is one of the following :
      - READY_TO_UPLOAD
      - READY_TO_EXECUTE
      Calling loadMission when the current state is READY_TO_EXECUTE will change the state to READY_TO_UPLOAD. After calling getLoadedMission,

      Input Parameters:
      @NonNull WaypointV2Mission missionWaypoint mission to load.
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackReturns an error when mission data is invalid or the mission cannot be loaded in the current state.
      Loaded Action Count
      method
      method getLoadedActionCount
      int getLoadedActionCount()
      Package:dji.sdk.mission.waypoint
      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. 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.

      Return:
      intAn int value of loaded action count.
      Loaded Actions
      method
      method getLoadedActions
      @Nullable
      List<WaypointV2Action> getLoadedActions()
      Package:dji.sdk.mission.waypoint
      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. 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 null, if user want get summary of the executing actions user can call downloadMission to get all the information for the loaded actions. The getLoadedActions will be reset to null when the execution of the getLoadedMission is stopped, finished.

      Return:
      List<WaypointV2Action>A list of WaypointV2Action objects.
      Current State
      method
      method getCurrentState
      @NonNull
      WaypointV2MissionState getCurrentState()
      Package:dji.sdk.mission.waypoint
      Description:

      The current state of the operator.

      Return:
      WaypointV2MissionStateAn object of WaypointV2MissionState.
      Current Action State
      method
      method getCurrentActionState
      @NonNull
      ActionState getCurrentActionState()
      Package:dji.sdk.mission.waypoint
      Description:

      The current action state of the operator.

      Return:
      ActionStateAn object of ActionState.
      Upload Mission
      method
      method uploadMission
      void uploadMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Starts to upload the getLoadedMission to the aircraft. It can only be called when the getLoadedMission is complete and the DJIWaypointV2MissionActionExecutionEvent_currentState is READY_TO_UPLOAD. 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 WaypointV2MissionState will become READY_TO_EXECUTE. If it is started successfully, use DJIWaypointV2MissionOperator_Listener_onUploadUpdate to receive the detailed progress.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback will be invoked with the result if the upload command has been received successfully by the aircraft. If the upload command is successfully sent, use addWaypointEventListener to check the detailed progress.
      Upload Waypoint Actions
      method
      method uploadWaypointActions
      void uploadWaypointActions(List<WaypointV2Action> actions, @Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Starts to upload the getLoadedActions to the aircraft. It can only be called when the getLoadedActions is complete and the DJIWaypointV2MissionActionExecutionEvent_currentState is READY_TO_EXECUTE. 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 READY_TO_EXECUTE.

      Input Parameters:
      List<WaypointV2Action> actionsA list of WaypointV2Action objects.
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback will be invoked with the result if the upload action command has been received successfully by the aircraft. If the upload command is successfully sent, use addActionListener to check the detailed progress.
      Download Mission
      method
      method downloadMission
      void downloadMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Downloads information of each waypoint from aircraft and save it to getLoadedMission. If a download operation starts, the operator will download the information of waypoints missing in getLoadedMission one-by-one in ascending order. If getLoadedMission is already complete (containing all the waypoints), this method will call completion immediately without error. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is one of the following:
      - Executing
      - INTERRUPTED.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback that will be called when the download operation succeeds or fails to start. If it is started successfully, use DJIWaypointV2MissionOperator_Listener_onDownloadUpdate to receive the detailed progress.
      method downloadActions
      void downloadActions(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Downloads information of Actions from startActionID to endActionID. The information of waypoints missing in getLoadedMission ascending order. If getLoadedMission is already complete (containing all the waypoints), this method will call completion immediately without error. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is one of the following:
      - Executing
      - INTERRUPTED

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback that will be called when the download operation succeeds or fails to start. If it is started successfully, use DJIWaypointV2MissionOperator_addListenerToDownloadEvent to receive the detailed progress.


      Listener

      Add to Listen for Waypoint Event
      method
      method addWaypointEventListener
      void addWaypointEventListener(@NonNull final WaypointV2MissionOperatorListener listener)
      Package:dji.sdk.mission.waypoint
      Description:

      Add listener to listen for waypoint events.

      Input Parameters:
      @NonNull final WaypointV2MissionOperatorListener listenerAn object of DJIWaypointV2MissionOperator_Listener.
      Remove Listener
      method
      method removeWaypointListener
      void removeWaypointListener(@NonNull WaypointV2MissionOperatorListener listener)
      Package:dji.sdk.mission.waypoint
      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.

      Input Parameters:
      @NonNull WaypointV2MissionOperatorListener listenerListener to be removed.
      Add Action Listener
      method
      method addActionListener
      void addActionListener(@NonNull final WaypointV2ActionListener listener)
      Package:dji.sdk.mission.waypoint
      Description:

      Add listener to listen the events.

      Input Parameters:
      @NonNull final WaypointV2ActionListener listenerAn object of DJIWaypointV2MissionOperator_ActionListener.
      Remove Action Listener
      method
      method removeActionListener
      void removeActionListener(@NonNull WaypointV2ActionListener listener)
      Package:dji.sdk.mission.waypoint
      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.

      Input Parameters:
      @NonNull WaypointV2ActionListener listenerListener to be removed.


      Mission Execution

      Start Mission
      method
      method startMission
      void startMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Starts the execution of the uploaded mission. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is READY_TO_EXECUTE. After a mission is started successfully, the DJIWaypointV2MissionActionExecutionEvent_currentState will become Executing.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCompletion block that will be called when the operator succeeds or fails to start the execution. If it fails, an error will be returned.
      Interrupt Mission
      method
      method interruptMission
      void interruptMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Pauses the executing mission. It can only be called when the WaypointV2MissionState is Executing. After a mission is paused successfully, the DJIWaypointV2MissionActionExecutionEvent_currentState will become INTERRUPTED.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback that will be called when the operator succeeds or fails to pause the mission. If it fails, an error will be returned.
      Recover Mission
      method
      method recoverMission
      void recoverMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Resumes the paused mission. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is INTERRUPTED. After a mission is resumed successfully, the DJIWaypointV2MissionActionExecutionEvent_currentState will become Executing.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback that will be called when the operator succeeds or fails to resume the mission. If it fails, an error will be returned.
      method recoverMission
      void recoverMission(@NonNull InterruptRecoverActionType type, @Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Resumes the paused mission with recover type. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is INTERRUPTED. After a mission is resumed successfully, the DJIWaypointV2MissionActionExecutionEvent_currentState will become Executing.

      Input Parameters:
      @NonNull InterruptRecoverActionType typeAn enum value of InterruptRecoverActionType
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCallback that will be called when the operator succeeds or fails to resume the mission. If it fails, an error will be returned.
      Stop Mission
      method
      method stopMission
      void stopMission(@Nullable CompletionCallback<DJIWaypointV2Error> callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Stops the executing or paused mission. It can only be called when the DJIWaypointV2MissionActionExecutionEvent_currentState is one of the following:
      - Executing
      - INTERRUPTED After a mission finishes successfully, DJIWaypointV2MissionActionExecutionEvent_currentState will become READY_TO_UPLOAD.

      Input Parameters:
      @Nullable CompletionCallback<DJIWaypointV2Error> callbackCompletion block that will be called when the operator succeeds or fails to resume the mission. If it fails, an error will be returned.