DJI Mobile SDK Documentation

      class ShootPhotoAction

      class ShootPhotoAction extends MissionAction
      Package:dji.sdk.mission.timeline.actions
      Inherits From:MissionAction
      Description:

      This class represents a shoot photo action used as an element in a Timeline mission. By creating an object of this class and adding it to Mission Control's Timeline, the camera can shoot a photo when the Timeline reaches the action.

      Class Members:
      Constructor
      method
      method newShootSinglePhotoAction
      static ShootPhotoAction newShootSinglePhotoAction()
      Package:dji.sdk.mission.timeline.actions
      Description:

      Initialize object to shoot a single photo.

      Return:
      static ShootPhotoActionAn instance of ShootPhotoAction.
      method newShootIntervalPhotoAction
      static ShootPhotoAction newShootIntervalPhotoAction(int count, int interval)
      Package:dji.sdk.mission.timeline.actions
      Description:

      Initialize object to shoot multiple photos.

      Input Parameters:
      int countPhoto count.
      int intervalTime interval in seconds between shooting photos.
      Return:
      static ShootPhotoActionAn instance of ShootPhotoAction.
      method newStopIntervalPhotoAction
      static ShootPhotoAction newStopIntervalPhotoAction()
      Package:dji.sdk.mission.timeline.actions
      Description:

      Initialize object to stop shooting photos. Only works if there was a previous ShootPhotoAction in the timeline which started shooting photos using the newShootIntervalPhotoAction initializer with wait set to false.

      Return:
      static ShootPhotoActionAn instance of ShootPhotoAction.
      Camera Index
      method
      method setCameraIndex
      void setCameraIndex(int index)
      Package:dji.sdk.mission.timeline.actions
      Description:

      Set the expected action camera index. For example there are two cameras in M210, if you want to run action on camera I, you can either set the index as 0 or do nothing because of the default index is 0; if you want to run action on camera II, you need set the index as 1. Default index is 0 if user does not call this method to specify the index.

      Input Parameters:
      int indexIndex of the camera on which the action is expected to run.
      ShootPhotoAction
      class
      Inherited Methods:
      dji.sdk.mission.timeline.actions.MissionAction
      method
      method isRunning
      boolean isRunning()
      Package:dji.sdk.mission.timeline.actions
      Description:

      true if the action is running.

      Return:
      booleanA boolean value.
      Inherited Methods:
      dji.sdk.mission.timeline.TimelineElement
      method
      method getTriggers
      List<Trigger> getTriggers()
      Package:dji.sdk.mission.timeline
      Description:

      If implemented, Mission Control loads and activates the triggers for the duration that the Timeline element is executing.

      Return:
      List<Trigger>A List of Trigger object.
      method setTriggers
      void setTriggers(List<Trigger> triggers)
      Package:dji.sdk.mission.timeline
      Description:

      Set the triggers array list to the timeline.

      Input Parameters:
      List<Trigger> triggersA list of Trigger objects.
      method isPausable
      boolean isPausable()
      Package:dji.sdk.mission.timeline
      Description:

      true if the element can be paused. If false, then when the Timeline is asked to pause when this element is running, nothing will happen.

      Return:
      booleantrue if the element can be paused.
      method checkValidity
      DJIError checkValidity()
      Package:dji.sdk.mission.timeline
      Description:

      Returns an error if there is a configuration or parameter error in the element. Returns null if there is no issue.

      Return:
      DJIErrorA DJIError object.
      method
      method willRun
      void willRun()
      Package:dji.sdk.mission.timeline
      Description:

      If Implemented, this is called by Mission Control right before running the element.

      method
      method run
      void run()
      Package:dji.sdk.mission.timeline
      Description:

      Starts execution of Timeline element. Missions adopting this behavior are being run with their respective operators.

      method
      method pause
      void pause()
      Package:dji.sdk.mission.timeline
      Description:

      Pauses the execution of the element. Must be implemented if isPausable returns true.

      method
      method resume
      void resume()
      Package:dji.sdk.mission.timeline
      Description:

      Resumes the execution of the element. Must be implemented if isPausable returns true.

      method
      method stop
      void stop()
      Package:dji.sdk.mission.timeline
      Description:

      Stops execution of the element.

      method
      method didRun
      void didRun()
      Package:dji.sdk.mission.timeline
      Description:

      Called after element execution, regardless of whether or not it was successful.

      method setDelayTime
      void setDelayTime(long delayTime)
      Package:dji.sdk.mission.timeline
      Description:

      Sets the time you want to delay before element execution which is used for asynchronous processing scenarios. For example, if you want to execute GimbalAttitudeAction after ShootPhotoAction, you should set delay time in GimbalAttitudeAction. Because it takes 1 to 2 seconds to take a photo, the gimbal's commands will not be responded during this period, so we need to delay 2 seconds before turning the gimbal to ensure that the gimbal movement is executed correctly.

      Input Parameters:
      long delayTimeThe time you want to delay before element execution, unit:second.
      method getDelayTime
      long getDelayTime()
      Package:dji.sdk.mission.timeline
      Description:

      Gets the time you want to delay before element execution.

      Return:
      longThe time you set to delay before element execution.