DJI Mobile SDK Documentation

      class ActiveTrackMission

      @EXClassNullAway
      class ActiveTrackMission
      Package:dji.common.mission.activetrack
      Description:

      ActiveTrack Mission allows an aircraft to track a moving subject using the vision system and without a GPS tracker on the subject.

      Class Members:
      Target Rect
      method
      method setTargetRect
      void setTargetRect(RectF targetRect)
      Package:dji.common.mission.activetrack
      Description:

      A bounding box for the target. The rectangle is normalized to [0,1] where (0,0) is the top left of the video preview and (1,1) is the bottom right. The size parameter of CGRect can be set to 0 to initialize the mission with a point instead of a rectangle. If the mission is initialized with a point, the vision system will try to recognize the object around the point and return the representative rect in the status delegate.

      This property is used when the ActiveTrackMission object is passed to startTracking. If the object is passed to startAutoSensingMission, this property will be ignored. Use setTargetIndex to select the target to track instead.

      Input Parameters:
      RectF targetRectA RectF object.
      method getTargetRect
      RectF getTargetRect()
      Package:dji.common.mission.activetrack
      Description:

      Get RectF object that represents target

      Return:
      RectFA RectF object.
      Subject Index
      method
      method setTargetIndex
      void setTargetIndex (int targetIndex)
      Package:dji.common.mission.activetrack
      Description:

      The index of the subject to track. After starting auto sensing (by calling enableAutoSensing or enableAutoSensingForQuickShot), the aircraft will push the sensed subjects (getAutoSensedSubjects). Select the subject to track by passing the index of the subject.

      This property is used when the ActiveTrackMission object is passed to startAutoSensingMission. If the object is passed to startTracking, this property will be ignored. Use setTargetRect to define the target to track.

      Input Parameters:
      int targetIndexThe index of the subject to track.
      Mode
      method
      method setMode
      void setMode(ActiveTrackMode mode)
      Package:dji.common.mission.activetrack
      Description:

      ActiveTrack Mission mode. Defaults to TRACE.

      Input Parameters:
      ActiveTrackMode modeAn enum value of ActiveTrackMode.
      method getQuickShotMode
      QuickShotMode getQuickShotMode()
      Package:dji.common.mission.activetrack
      Description:

      The QuickShot mode determines the preset flight path. It is only used when setMode is QUICK_SHOT. Defaults to UNKNOWN. It is only supported by Spark.

      Return:
      QuickShotModeAn enum value of QuickShotMode.
      method setQuickShotMode
      void setQuickShotMode(QuickShotMode quickShotMode)
      Package:dji.common.mission.activetrack
      Description:

      Set the QuickShot mode. It is only supported by Spark.

      Input Parameters:
      QuickShotMode quickShotModeAn enum value of QuickShotMode.
      method getSpotlightMode
      SpotlightMode getSpotlightMode()
      Package:dji.common.mission.activetrack
      Description:

      Gets the spotlight mode. It is only used when setMode is SPOTLIGHT. Defaults to UNKNOWN.

      Return:
      SpotlightModeAn enum value of SpotlightMode.
      method setSpotlightMode
      void setSpotlightMode(SpotlightMode spotlightMode)
      Package:dji.common.mission.activetrack
      Description:

      Set the Spotlight mode.

      Input Parameters:
      SpotlightMode spotlightModeAn enum value of SpotlightMode.
      method ActiveTrackMission
      ActiveTrackMission(RectF targetRect, ActiveTrackMode mode)
      Package:dji.common.mission.activetrack
      Description:

      A constructor method for ActiveTrackMission. The first param can be nullable if the object is passed to startAutoSensingMission.

      Input Parameters:
      RectF targetRectThe target rect.
      ActiveTrackMode modeAn enum value of ActiveTrackMode.
      method
      method getMode
      ActiveTrackMode getMode()
      Package:dji.common.mission.activetrack
      Description:

      Get the current ActiveTrack mode for ActiveTrack mission.

      Return:
      ActiveTrackModeAn enum value of ActiveTrackMode.
      method getTargetIndex
      int getTargetIndex()
      Package:dji.common.mission.activetrack
      Description:

      Get Target Index.

      Return:
      intAn int value of target index.
      enum ActiveTrackMode
      @EXClassNullAway
      enum ActiveTrackMode
      Package:dji.common.mission.activetrack
      SDK Key:FlightControllerKey.ACTIVE_TRACK_MODE
      Description:

      Different modes of the ActiveTrack Mission. Defaults to TRACE, set to others to enable the feature.

      Enum Members:
      TRACEAircraft moves in behind the subject keeping a constant distance to it. Mission with this mode can only be started when the aircraft is flying.
      PROFILEAircraft moves in parallel with the subject in the frame instead of behind. Mission with this mode can only be started when the aircraft is flying.
      SPOTLIGHTIn Spotlight mode, the aircraft camera automatically follows the subject by rotating the aircraft's yaw, but the aircraft does not automatically keep a constant distance with the subject. Mission with this mode can only be started when the aircraft is flying.
      SPOTLIGHT_PROIn Spotlight Pro mode, the aircraft camera automatically follows the subject by rotating the gimbal's yaw, but the aircraft does not automatically keep a constant distance with the subject. Not Supported by Mavic Air 2, DJI Air 2S.
      QUICK_SHOTIn QuickShot mode, the aircraft will fly in one of four preset paths (see QuickShotMode) while tracking the object recording a video. When a QuickShot mission ends, a 10-second video will be generated. Supported by Spark and Mavic 2 Series.
      CIRCLEAircraft will circle around the object it is tracking. Only Supported by Mavic Air 2 and Mavic 2 Series.
      UNKNOWNThe active track mode is unknown.
      Class Members:
      enum QuickShotMode
      @EXClassNullAway
      enum QuickShotMode
      Package:dji.common.mission.activetrack
      Description:

      QuickShot modes, which define different preset path for a QuickShot mission.

      Enum Members:
      CIRCLEAircraft will circle around the object it is tracking.
      DRONIEAircraft will fly backward and upward with camera locked on the object it is tracking.
      HELIXAircraft will fly upward, spiraling around the object it is tracking.
      ROCKETThe aircraft will ascend with the camera pointing downward on the object it is tracking.
      BOOMERANGThe aircraft will fly around the tracking object in an upwardly sloped oval with the video finishing at the start point. Supported by DJI Mavic Air, Mavic 2 Zoom and Mavic 2 Pro.
      ASTEROIDThe aircraft will fly backward and upward while recording video, capture a sphere panorama at the end of the flight path, then combine the footage and panorama into a short video. Supported by DJI Mavic Air, Mavic 2 Zoom and Mavic 2 Pro.
      DOLLY_ZOOMThe aircraft will fly backward and upward. It will adjust the zoom during flight to keep the selected subject the same while the background changes. Ensure there is sufficient space when using Dolly Zoom. Allow at least triple distance from aircraft to the subject behind the aircraft. Only supported by Mavic 2 Zoom.
      UNKNOWNUnknown.
      Class Members:
      enum SpotlightMode
      enum SpotlightMode
      Package:dji.common.mission.activetrack
      Description:

      Spotlight modes, which define different submode for a Spotlight mission.

      Enum Members:
      ZOOM_GIMBAL_FOLLOWINGIn gimbal follow mode, the orientation of the aircraft heading is always consitent with the gimbal, both aiming at the target. At this time, the attitude of the gimbal will be automatically adjusted so that the target can be in the center of the screen, and the user can fine-tune the field of view by triming the gimbal dial; the camera will automatically adjust the zoom to make the size of the target suitable.
      ZOOM_GIMBAL_FREEIn gimbal free mode, the spot light tracking will only control the gimbal to track the target instead of the drone so that the landing gear of the aircraft may appear in the view and the gimbal rotation range is limited by the gimbal mechanical limit.
      Class Members: