class MissionControl
class MissionControl implements TimelineElementFeedback , Triggerable
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
method getWaypointMissionOperator
@NonNull WaypointMissionOperator getWaypointMissionOperator ()
Description:
Returns the operator for waypoint missions.
Return:
method getHotpointMissionOperator
@NonNull HotpointMissionOperator getHotpointMissionOperator ()
Description:
Returns the operator for Hotpoint missions.
Return:
method getFollowMeMissionOperator
@NonNull FollowMeMissionOperator getFollowMeMissionOperator ()
Description:
Returns the operator for Follow Me missions.
Return:
ActiveTrack Mission
method
method getActiveTrackOperator
@NonNull ActiveTrackOperator getActiveTrackOperator ()
Description:
Returns the operator for ActiveTrack missions.
Return:
method getTapFlyMissionOperator
@NonNull TapFlyMissionOperator getTapFlyMissionOperator ()
Description:
Returns the operator for TapFly missions.
Return:
method getPanoramaMissionOperator
@NonNull PanoramaMissionOperator getPanoramaMissionOperator ()
Description:
Returns the operator for Panorama missions.
Return:
Intelligent Hotpoint Mission
method
method getIntelligentHotpointMissionOperator
@NonNull IntelligentHotpointMissionOperator getIntelligentHotpointMissionOperator ()
Description:
Returns the operator for Intelligent Hotpoint missions.
Return:
Waypoint V2 Mission
method
method getWaypointMissionV2Operator
@Nullable WaypointV2MissionOperator getWaypointMissionV2Operator ()
Description:
Returns the operator for waypoint v2 mission. Only Supported by Matrice 300 RTK.
Return:
Timeline
method scheduleElement
DJIError scheduleElement (@NonNull TimelineElement element)
Description:
Adds an element to the end of the Timeline.
Return:
DJIError The first error if one occurred.
method scheduleElements
DJIError scheduleElements (@NonNull List<TimelineElement> elements)
Description:
Adds a list of elements to the end of the Timeline.
Return:
DJIError The first error if one occurred.
method scheduleElementAtIndex
DJIError scheduleElementAtIndex (TimelineElement element, int index)
Description:
Insert an element into the Timeline at an index.
Return:
DJIError The first error if one occurred.
method unscheduleElement
void unscheduleElement (TimelineElement element)
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.
method unscheduleElementAtIndex
void unscheduleElementAtIndex (int index)
Description:
Removes the Element at an index in the Timeline.
int index Index of element to remove.
method scheduledElementAtIndex
@Nullable TimelineElement scheduledElementAtIndex (int index)
Description:
Returns the element at a given index in the Timeline.
int index An element index in the Timeline.
Return:
TimelineElement Either a mission, an element or null
if nothing was at the given index.
method scheduledCount
Description:
Returns the number of elements within the Timeline.
Return:
method unscheduleEverything
void unscheduleEverything ()
Description:
Clears the Timeline, removing all elements.
method setTriggers
@Override void setTriggers (List<Trigger> triggers)
Description:
Set the triggers for the Timeline.
method getTriggers
@Override List<Trigger> getTriggers ()
Description:
Returns the list of triggers which are dependents of the Timeline.
Return:
method pauseTimeline
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
Description:
Resume element and Timeline execution.
method stopTimeline
Description:
Stops the execution of the Timeline, resets the marker index to 0. Release thread resources of timeline.
method isTimelineRunning
boolean isTimelineRunning ()
Description:
true
if the Timeline is running.
Return:
boolean A boolean value that is true
if Timeline is running.
method getCurrentTimelineMarker
int getCurrentTimelineMarker ()
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:
int Timeline element index.
method setCurrentTimelineMarker
void setCurrentTimelineMarker (int currentTimelineMaker)
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).
int currentTimelineMaker Timeline element index.
method isTimelinePaused
boolean isTimelinePaused ()
Description:
true
if Timeline is paused.
Return:
boolean true
if Timeline is paused.
method getRunningElement
@Nullable TimelineElement getRunningElement ()
Description:
The current element that is running in the Timeline. If the Timeline is not running, then this is null
.
Return:
method addListener
void addListener (Listener listener)
Description:
Adds a listener to all Timeline events.
Listener listener A listener object.
method removeListener
void removeListener (Listener listener)
Description:
Removes the listener from the Timeline events listeners pool.
Listener listener A previously added listener object.
method removeAllListeners
void removeAllListeners ()
Description:
Removes all listeners from the Timeline events listeners pool.
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: