DJI Mobile SDK Documentation

      class MissionControl

      class MissionControl implements TimelineElementFeedback, Triggerable
      Package:dji.sdk.mission
      Description:

      Mission Control handles execution of missions. Either single missions can be run through dedicated mission operators, or a series of missions and actions can be run serially using the Timeline.

      Mission operators look after execution of a single mission. A mission operator has APIs to control the mission (e.g. start, stop, pause etc.) and provides mission state through listeners.

      Mission Control's Timeline is made up of a series of Timeline elements which can be Waypoint missions, Hotpoint missions (through the Hotpoint action HotpointAction) or objects that follow the TimelineElement protocol. MissionAction is a Timeline element, with AircraftYawAction and GimbalAttitudeAction subclasses being examples of specific actions. If a mission is being executed in a Timeline, the mission operator can still be used to get state information of the mission as well as change mission execution parameters.

      Timeline elements can also have triggers (Trigger) associated with them. Triggers are separate objects that are run in parallel with a Timeline element. The trigger object is used to initiate actions if a set of criteria are met. For example, a trigger could be used to monitor battery level, and then initiate an action once a threshold is passed. Mission Control's Timeline is only supported by aircrafts. Handheld devices (e.g. OSMO) do not support this feature.

      > Mission Control is accessed from getMissionControl in DJISDKManager.

      Class Members:

      Mission Operators

      Waypoint Mission
      method
      method getWaypointMissionOperator
      @NonNull
      WaypointMissionOperator getWaypointMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for waypoint missions.

      Return:
      WaypointMissionOperatorA Waypoint mission operator object.
      Hotpoint Mission
      method
      method getHotpointMissionOperator
      @NonNull
      HotpointMissionOperator getHotpointMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for Hotpoint missions.

      Return:
      HotpointMissionOperatorA Hotpoint mission operator object.
      Follow Me Mission
      method
      method getFollowMeMissionOperator
      @NonNull
      FollowMeMissionOperator getFollowMeMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for Follow Me missions.

      Return:
      FollowMeMissionOperatorA Follow Me mission operator object.
      ActiveTrack Mission
      method
      method getActiveTrackOperator
      @NonNull
      ActiveTrackOperator getActiveTrackOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for ActiveTrack missions.

      Return:
      ActiveTrackOperatorAn ActiveTrack mission operator object.
      Tap Fly Mission
      method
      method getTapFlyMissionOperator
      @NonNull
      TapFlyMissionOperator getTapFlyMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for TapFly missions.

      Return:
      TapFlyMissionOperatorA TapFly mission operator object.
      Panorama Mission
      method
      method getPanoramaMissionOperator
      @NonNull
      PanoramaMissionOperator getPanoramaMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for Panorama missions.

      Return:
      PanoramaMissionOperatorA Panorama mission operator object.
      Intelligent Hotpoint Mission
      method
      method getIntelligentHotpointMissionOperator
      @NonNull
      IntelligentHotpointMissionOperator getIntelligentHotpointMissionOperator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for Intelligent Hotpoint missions.

      Return:
      IntelligentHotpointMissionOperatorAn Intelligent Hotpoint mission operator object.
      Waypoint V2 Mission
      method
      method getWaypointMissionV2Operator
      @Nullable
      WaypointV2MissionOperator getWaypointMissionV2Operator()
      Package:dji.sdk.mission
      Description:

      Returns the operator for waypoint v2 mission. Only Supported by Matrice 300 RTK.

      Return:
      WaypointV2MissionOperatorAn waypoint v2 mission operator object.


      Timeline

      Setup
      method
      method scheduleElement
      DJIError scheduleElement(@NonNull TimelineElement element)
      Package:dji.sdk.mission
      Description:

      Adds an element to the end of the Timeline.

      Input Parameters:
      @NonNull TimelineElement elementA TimelineElement element.
      Return:
      DJIErrorThe first error if one occurred.
      method scheduleElements
      DJIError scheduleElements(@NonNull List<TimelineElement> elements)
      Package:dji.sdk.mission
      Description:

      Adds a list of elements to the end of the Timeline.

      Input Parameters:
      @NonNull List<TimelineElement> elementsA list of TimelineElement elements.
      Return:
      DJIErrorThe first error if one occurred.
      method scheduleElementAtIndex
      DJIError scheduleElementAtIndex(TimelineElement element, int index)
      Package:dji.sdk.mission
      Description:

      Insert an element into the Timeline at an index.

      Input Parameters:
      TimelineElement elementA TimelineElement element
      int indexThe element index to insert the new element before.
      Return:
      DJIErrorThe first error if one occurred.
      method unscheduleElement
      void unscheduleElement(TimelineElement element)
      Package:dji.sdk.mission
      Description:

      Remove element from the Timeline. If the same element was used more than once in the Timeline, then the first one will be removed.

      Input Parameters:
      TimelineElement elementA TimelineElement element that is already in the Timeline.
      method unscheduleElementAtIndex
      void unscheduleElementAtIndex(int index)
      Package:dji.sdk.mission
      Description:

      Removes the Element at an index in the Timeline.

      Input Parameters:
      int indexIndex of element to remove.
      method scheduledElementAtIndex
      @Nullable
      TimelineElement scheduledElementAtIndex(int index)
      Package:dji.sdk.mission
      Description:

      Returns the element at a given index in the Timeline.

      Input Parameters:
      int indexAn element index in the Timeline.
      Return:
      TimelineElementEither a mission, an element or null if nothing was at the given index.
      method scheduledCount
      int scheduledCount()
      Package:dji.sdk.mission
      Description:

      Returns the number of elements within the Timeline.

      Return:
      intElement count.
      method unscheduleEverything
      void unscheduleEverything()
      Package:dji.sdk.mission
      Description:

      Clears the Timeline, removing all elements.

      Schedule Trigger
      method
      method setTriggers
      @Override
      void setTriggers(List<Trigger> triggers)
      Package:dji.sdk.mission
      Description:

      Set the triggers for the Timeline.

      Input Parameters:
      List<Trigger> triggersList of Trigger objects.
      method getTriggers
      @Override
      List<Trigger> getTriggers()
      Package:dji.sdk.mission
      Description:

      Returns the list of triggers which are dependents of the Timeline.

      Return:
      List<Trigger>Trigger list.
      Control
      method
      method startTimeline
      void startTimeline()
      Package:dji.sdk.mission
      Description:

      Start Timeline execution from the current element index getCurrentTimelineMarker.

      method pauseTimeline
      void pauseTimeline()
      Package:dji.sdk.mission
      Description:

      Pause execution of the Timeline, and current element (if pausible). If the current element is not pausible then this method will do nothing.

      method resumeTimeline
      void resumeTimeline()
      Package:dji.sdk.mission
      Description:

      Resume element and Timeline execution.

      method stopTimeline
      void stopTimeline()
      Package:dji.sdk.mission
      Description:

      Stops the execution of the Timeline, resets the marker index to 0. Release thread resources of timeline.

      method isTimelineRunning
      boolean isTimelineRunning()
      Package:dji.sdk.mission
      Description:

      true if the Timeline is running.

      Return:
      booleanA boolean value that is true if Timeline is running.
      method getCurrentTimelineMarker
      int getCurrentTimelineMarker()
      Package:dji.sdk.mission
      Description:

      Tells the index in the timeline array that marks where the timeline is currently at. Changing this value will reposition where the timeline will resume/start work.

      Return:
      intTimeline element index.
      method setCurrentTimelineMarker
      void setCurrentTimelineMarker(int currentTimelineMaker)
      Package:dji.sdk.mission
      Description:

      Sets the element index within the Timeline to start execution. This value can be set only when a Timeline is stopped (not executing or paused).

      Input Parameters:
      int currentTimelineMakerTimeline element index.
      method isTimelinePaused
      boolean isTimelinePaused()
      Package:dji.sdk.mission
      Description:

      true if Timeline is paused.

      Return:
      booleantrue if Timeline is paused.
      method getRunningElement
      @Nullable
      TimelineElement getRunningElement()
      Package:dji.sdk.mission
      Description:

      The current element that is running in the Timeline. If the Timeline is not running, then this is null.

      Return:
      TimelineElementTimeline element
      Listener
      method
      method addListener
      void addListener(Listener listener)
      Package:dji.sdk.mission
      Description:

      Adds a listener to all Timeline events.

      Input Parameters:
      Listener listenerA listener object.
      method removeListener
      void removeListener(Listener listener)
      Package:dji.sdk.mission
      Description:

      Removes the listener from the Timeline events listeners pool.

      Input Parameters:
      Listener listenerA previously added listener object.
      method removeAllListeners
      void removeAllListeners()
      Package:dji.sdk.mission
      Description:

      Removes all listeners from the Timeline events listeners pool.


      Timeline Element
      class
      Timeline Event
      class
      enum TimelineEvent
      enum TimelineEvent
      Package:dji.sdk.mission.timeline
      Description:

      Events that can initiate a call to the Mission Control listener.

      Enum Members:
      UNKNOWNUnknown event type. This is a default value if no other event is matching.
      STARTEDTimeline successfully started.
      START_ERRORTimeline failed to start.
      PROGRESSEDTimeline element progressed.
      PAUSEDTimeline successfully paused.
      PAUSE_ERRORTimeline failed to be paused.
      RESUMEDTimeline successfully resumed.
      RESUME_ERRORTimeline failed to resume.
      STOPPEDTimeline Stopped successfully.
      STOP_ERRORTimeline failed to stop and is still continuing in its previous state.
      FINISHEDTimeline completed its execution normally.
      Class Members: