DJI Mobile SDK Documentation

      class WaypointMissionOperator

      class WaypointMissionOperator
      Package:dji.sdk.mission.waypoint
      Description:

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

      Class Members:

      Preparation

      Operator
      method
      method loadMission
      @Nullable
      DJIError loadMission(@NonNull WaypointMission mission)
      Package:dji.sdk.mission.waypoint
      Description:

      Loads the WaypointMission into device memory. This also verifies all the information of mission. If something is incorrect, callback.result() will be called with an Error. Otherwise, callback.result() will be called with a null value. The mission object will remain in device memory even after the WaypointMission execution has finished.

      Input Parameters:
      @NonNull WaypointMission missionWaypoint mission to load.
      Return:
      DJIErrorReturns an error when mission data is invalid or the mission cannot be loaded in the current state.
      method getLoadedMission
      @Nullable
      WaypointMission 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 or interrupted.

      Return:
      WaypointMissionA object of WaypointMission.
      Get Previous Interruption
      method
      method getPreviousInterruption
      void getPreviousInterruption(CommonCallbacks.CompletionCallbackWith<WaypointMissionInterruption> callback)
      Package:dji.sdk.mission.waypoint
      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. Supported only by Phantom 4 RTK.

      Input Parameters:
      CommonCallbacks.CompletionCallbackWith<WaypointMissionInterruption> callbackThe execution callback with the returned execution result.
      Mission Upload to Aircraft
      method
      method uploadMission
      void uploadMission(@Nullable final CompletionCallback 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 getCurrentState 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 WaypointMissionState will become READY_TO_EXECUTE.

      Input Parameters:
      @Nullable final CompletionCallback callbackCompletion block that will be called when the upload operation succeeds or fails to start.
      method retryUploadMission
      void retryUploadMission(@Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Retry upload waypoint mission.

      Input Parameters:
      @Nullable CompletionCallback callbackThe execution callback with the returned execution result.
      Mission Download from Aircraft
      method
      method downloadMission
      void downloadMission(@Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Downloads information of each waypoint from aircraft and save it to getLoadedMission. If a download operation is started, 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 getCurrentState is one of the following: - EXECUTING - EXECUTION_PAUSED

      Input Parameters:
      @Nullable CompletionCallback callbackCompletion callback that will be called when the download operation succeeds or fails to start.


      Mission Execution

      Execution
      method
      method startMission
      void startMission(@Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      Description:

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

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

      Resumes the paused mission. It can only be called when the getCurrentState is EXECUTION_PAUSED. After a mission is resumed successfully, the getCurrentState will become EXECUTING.

      Input Parameters:
      @Nullable CompletionCallback callbackCompletion block that will be called when the operator succeeds or fails to resume the mission. If it fails, an error will be returned.
      method pauseMission
      void pauseMission(@Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Pauses the executing mission. It can only be called when the WaypointMissionState is EXECUTING. After a mission is paused successfully, the getCurrentState will become EXECUTION_PAUSED.

      Input Parameters:
      @Nullable CompletionCallback callbackCompletion block that will be called when the operator succeeds or fails to pause the mission. If it fails, an error will be returned.
      method stopMission
      void stopMission(@Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      Description:

      Stops the executing or paused mission. It can only be called when the getCurrentState is one of the following: - EXECUTING - EXECUTION_PAUSED After a mission is stopped successfully, getCurrentState will become READY_TO_UPLOAD.

      Input Parameters:
      @Nullable CompletionCallback callbackCompletion block that will be called when the operator succeeds or fails to stop the mission. If it fails, an error will be returned.
      Auto flight speed
      method
      method setAutoFlightSpeed
      void setAutoFlightSpeed(@FloatRange(from = -15.0f, to = 15.0f) float speed,
      @Nullable CompletionCallback callback)
      Package:dji.sdk.mission.waypoint
      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.

      Input Parameters:
      @FloatRange(from = -15.0f, to = 15.0f) float speedAuto flight speed to be set. The absolute value of the auto flight speed should be less than or equal to the getMaxFlightSpeed. Its range is [-getMaxFlightSpeed, getMaxFlightSpeed] m/s.
      @Nullable CompletionCallback callbackCompletion callback.


      State

      method getCurrentState
      @NonNull
      WaypointMissionState getCurrentState()
      Package:dji.sdk.mission.waypoint
      Description:

      The current state of the operator.

      Return:
      WaypointMissionStateA object of WaypointMissionState.


      Listener

      Add
      method
      method addListener
      void addListener(@NonNull final WaypointMissionOperatorListener listener)
      Package:dji.sdk.mission.waypoint
      Description:

      Add listener to listen for events.

      Input Parameters:
      @NonNull final WaypointMissionOperatorListener listenerAn object of WaypointMissionOperatorListener.
      Remove
      method
      method removeListener
      void removeListener(@NonNull WaypointMissionOperatorListener 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 WaypointMissionOperatorListener listenerListener to be removed.


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

      Listener interface for Waypoint mission operator events.

      Interface Methods:
      Upload
      method
      method onUploadUpdate
      void onUploadUpdate(@NonNull WaypointMissionUploadEvent uploadEvent)
      Package:dji.sdk.mission.waypoint
      Description:

      Called when an upload event happens.

      Input Parameters:
      @NonNull WaypointMissionUploadEvent uploadEventUpload event
      Download
      method
      method onDownloadUpdate
      void onDownloadUpdate(@NonNull WaypointMissionDownloadEvent downloadEvent)
      Package:dji.sdk.mission.waypoint
      Description:

      Called when an download event happens.

      Input Parameters:
      @NonNull WaypointMissionDownloadEvent downloadEventDownload event
      Start
      method
      method onExecutionStart
      void onExecutionStart()
      Package:dji.sdk.mission.waypoint
      Description:

      Called when the waypoint mission starts.

      Execution
      method
      method onExecutionUpdate
      void onExecutionUpdate(@NonNull WaypointMissionExecutionEvent executionEvent)
      Package:dji.sdk.mission.waypoint
      Description:

      Called when there is an execution update for the waypoint mission operator.

      Input Parameters:
      @NonNull WaypointMissionExecutionEvent executionEventExecution event.
      Finish
      method
      method onExecutionFinish
      void onExecutionFinish(@Nullable DJIError error)
      Package:dji.sdk.mission.waypoint
      Description:

      Called when the waypoint mission ends.

      Input Parameters:
      @Nullable DJIError errorError if the waypoint mission didn't end as expected.