DJI Mobile SDK Documentation

      class Waypoint

      @EXClassNullAway
      class Waypoint
      Package:dji.common.mission.waypoint
      Description:

      The class represents a target point in the waypoint mission. For a waypoint mission, a flight route consists of multiple Waypoint objects. The user can also define the actions to perform for each Waypoint.

      Class Members:
      Constructor
      method
      method Waypoint
      Waypoint(double latitude, double longitude, float altitude)
      Package:dji.common.mission.waypoint
      Description:

      Initiate instance with specific waypoint.

      Input Parameters:
      double latitudeThe latitude of the waypoint.
      double longitudeThe longitude of the waypoint.
      float altitudeThe altitude of the waypoint.
      Coordinate
      property
      property coordinate
      LocationCoordinate2D coordinate
      Package:dji.common.mission.waypoint
      Description:

      Waypoint coordinate latitude and longitude in degrees.

      Altitude
      property
      property altitude
      @FloatRange(from = MIN_ALTITUDE, to = MAX_ALTITUDE) float altitude
      Package:dji.common.mission.waypoint
      Description:

      Altitude of the aircraft in meters when it reaches waypoint. The altitude of the aircraft is relative to the ground at the take-off location, and should not be larger than the aircraft's maximum altitude. If two adjacent waypoints have different altitudes, the altitude will gradually change as the aircraft flies between waypoints.

      Heading
      property
      property heading
      @IntRange(from = MIN_HEADING, to = MAX_HEADING) int heading
      Package:dji.common.mission.waypoint
      Description:

      The heading to which the aircraft will rotate by the time it reaches the waypoint. The aircraft heading will gradually change between two waypoints with different headings if the waypoint mission's getHeadingMode is set to USING_WAYPOINT_HEADING. A heading has a range of [-180, 180] degrees, where 0 represents True North. heading relate to behavior between this waypoint and the next waypoint in the mission.

      Corner Radius
      property
      property cornerRadiusInMeters
      @FloatRange(from = MIN_CORNER_RADIUS, to = MAX_CORNER_RADIUS) float cornerRadiusInMeters = 0.2f
      Package:dji.common.mission.waypoint
      Description:

      Corner radius of the waypoint. When the flight path mode is CURVED the flight path near a waypoint will be a curve (rounded corner) with radius [0.2,1000]. When there is a corner radius, the aircraft will never go through the waypoint. By default, the radius is 0.2 m. If the corner is made of three adjacent waypoints (Short for A,B,C) . Then the radius of A(short for Ra) plus radius of B(short for Rb) must be smaller than the distance between A and B. The radius of the first and the last waypoint in a mission does not affect the flight path and it should keep the default value (0.2m).

      See Also:

      cornerRadiusInMeters

      Turn Mode
      property
      property turnMode
      WaypointTurnMode turnMode
      Package:dji.common.mission.waypoint
      Description:

      Determines whether the aircraft will turn clockwise or anticlockwise when changing its heading. turnMode relate to behavior between this waypoint and the next waypoint in the mission. Not supported by Mavic 2 Series and Phantom 4 RTK.

      See Also:

      WaypointTurnMode

      Gimbal Pitch
      property
      property gimbalPitch
      @FloatRange(from = MIN_GIMBAL_PITCH, to = MAX_GIMBAL_PITCH) float gimbalPitch
      Package:dji.common.mission.waypoint
      Description:

      Gimbal pitch angle when reached this waypoint. This property is used when the isGimbalPitchRotationEnabled is TRUE. The range of the pitch angle should be gotten from the ADJUST_PITCH or ADJUST_PITCH_UPWARDS.

      Speed
      property
      property speed
      @FloatRange(from = MIN_SPEED, to = MAX_SPEED) float speed
      Package:dji.common.mission.waypoint
      Description:

      The base automatic speed of the aircraft as it moves between this waypoint and the next waypoint with range [0, 15] m/s. By default, it is 0.0 and the aircraft will fly with getAutoFlightSpeed of the waypoint mission. If greater than 0, 'speed' will override getAutoFlightSpeed. This 'speed' can only define movement forward through the waypoint mission in comparison to getAutoFlightSpeed which can be both forward and backwards through a waypoint mission.
      Waypoint mission speed priority from highest to lowest is:
      1) manual speed adjustment with remote controller joy sticks
      2) 'speed'
      3) DJIWaypointMissionOperator_setAutoFlightSpeed
      4) getAutoFlightSpeed
      Warning: 'speed', shootPhotoTimeInterval and shootPhotoDistanceInterval relate to behavior between this waypoint and the next waypoint in the mission. In comparison. Only supported by flight controller firmware 3.2.10.0 or above.

      Shoot Photo Time Interval
      property
      property shootPhotoTimeInterval
      float shootPhotoTimeInterval
      Package:dji.common.mission.waypoint
      Description:

      The time interval in seconds when two photos are taken as the aircraft moves between the current waypoint and the next waypoint. The first photo will be taken as the aircraft leaves the current waypoint. The maximum value is 6,000.0. The minimum value is above 0.0 and depends on the camera type and the camera parameters. When the photo file format is JPEG, the recommended minimum value is 2.0. When the photo file format is RAW, the minimum value is 10.0. If the input exceeds the camera's capability, the pictures will be taken at the maximum possible speed. The default value is 0.0 and no photo will be taken. For a waypoint, either shootPhotoTimeInterval or shootPhotoDistanceInterval is 0.0. Input with precision of greater than 1 decimal places, will be rounded to 1. Warning: 'speed', shootPhotoTimeInterval and shootPhotoDistanceInterval relate to behavior between this waypoint and the next waypoint in the mission. Only supported by flight controller firmware 3.2.10.0 or above.

      Shoot Photo Distance Interval
      property
      property shootPhotoDistanceInterval
      float shootPhotoDistanceInterval
      Package:dji.common.mission.waypoint
      Description:

      The distance interval in meters when two photos are taken as the aircraft moves between the current waypoint and the next waypoint. The maximum value is 6,000.0. The minimum value is above 0.0 and depends on the camera type, the camera parameters and the flight speed. When the photo file format is JPEG, the time interval between two photos cannot smaller than 2 seconds. When the photo file format is RAW, the time interval between two photos cannot smaller than 10 seconds. If the input exceeds the camera's capability, the taken photos may be less than expectation. The default value is 0.0 and no photo will be taken. For a waypoint, either shootPhotoTimeInterval or shootPhotoDistanceInterval is 0.0. Input with precision of greater than 1 decimal places, will be rounded to 1. Warning: 'speed', shootPhotoTimeInterval and shootPhotoDistanceInterval relate to behavior between this waypoint and the next waypoint in the mission. Only supported by flight controller firmware 3.2.10.0 or above.

      Actions
      property
      property waypointActions
      List<WaypointAction> waypointActions
      Package:dji.common.mission.waypoint
      Description:

      Array of all waypoint actions for the respective waypoint. The waypoint actions will be executed consecutively from the start of the array once the aircraft reaches the waypoint.

      method getActionAtIndex
      WaypointAction getActionAtIndex(int index)
      Package:dji.common.mission.waypoint
      Description:

      Gets the action at the specified index.

      Input Parameters:
      int indexThe specified index.
      Return:
      WaypointActionAn instance of WaypointAction.
      method adjustActionAtIndex
      boolean adjustActionAtIndex(int index, WaypointAction action)
      Package:dji.common.mission.waypoint
      Description:

      Switches the action at the specified index.

      Input Parameters:
      int indexThe specified index.
      WaypointAction actionA DJIWaypointAction object.
      Return:
      booleanA boolean value.
      property actionRepeatTimes
      @IntRange(from = MIN_ACTION_REPEAT_TIMES, to = MAX_ACTION_REPEAT_TIMES) int actionRepeatTimes = 1
      Package:dji.common.mission.waypoint
      Description:

      Determines how many times the set of waypoint actions are repeated. The default value is one time, and the maximum is MAX_ACTION_REPEAT_TIMES.

      See Also:

      MAX_ACTION_REPEAT_TIMES, actionRepeatTimes

      property actionTimeoutInSeconds
      @IntRange(from = MIN_ACTION_TIMEOUT, to = MAX_ACTION_TIMEOUT) int actionTimeoutInSeconds = 999
      Package:dji.common.mission.waypoint
      Description:

      The maximum time set to execute all the waypoint actions for a waypoint. If the time while executing the waypoint actions goes above the time set, the aircraft will stop executing the waypoint actions for the current waypoint and will move on to the next waypoint. The value of this property must be in the range of [0, 999] seconds. The default value is 60 seconds.

      See Also:

      actionTimeoutInSeconds

      Add Action
      method
      method addAction
      boolean addAction(WaypointAction action)
      Package:dji.common.mission.waypoint
      Description:

      Adds a waypoint action to a waypoint. The number of waypoint actions should not be larger than MAX_ACTION_COUNT. The action will only be executed when the mission's getFlightPathMode property is set to NORMAL and will not be executed when the mission's getFlightPathMode property is set to CURVED. The maximum number of waypoint actions you can add is 15.

      Input Parameters:
      WaypointAction actionWaypoint action to be added to the waypoint.
      Return:
      booleantrue if the waypoint action has been added to the waypoint. false if the waypoint action count is too high, or if the waypoint action was incorrectly setup.
      method insertAction
      boolean insertAction(WaypointAction action, int index)
      Package:dji.common.mission.waypoint
      Description:

      Insert a waypoint action at index. @return true, if the waypoint action has been inserted. false if the waypoint action count is too high or the index is invalid.

      Input Parameters:
      WaypointAction actionWaypoint action to be inserted to the waypoint.
      int indexIndex of the inserted action.
      Return:
      booleanA boolean value.
      Remove Action
      method
      method removeAction
      boolean removeAction(WaypointAction action)
      Package:dji.common.mission.waypoint
      Description:

      Removes a waypoint action from the waypoint. @return true if the waypoint action has been removed from the waypoint.

      Input Parameters:
      WaypointAction actionWaypoint action to be removed from the waypoint.
      Return:
      booleanA boolean value.
      method removeActionAtIndex
      boolean removeActionAtIndex(int index)
      Package:dji.common.mission.waypoint
      Description:

      Removes a waypoint action from the waypoint by index. After removal, all actions higher than the index will be shifted down by one.

      Input Parameters:
      int indexThe index of the waypoint action to be removed.
      Return:
      booleantrue if waypoint action has been removed from the waypoint.
      method removeAllAction
      void removeAllAction()
      Package:dji.common.mission.waypoint
      Description:

      Remove all the actions.

      enum WaypointTurnMode
      @EXClassNullAway
      enum WaypointTurnMode
      Package:dji.common.mission.waypoint
      Description:

      How the aircraft will turn at a waypoint to transition between headings.

      Enum Members:
      CLOCKWISEChanges the heading of the aircraft by rotating the aircraft clockwise.
      COUNTER_CLOCKWISEChanges the heading of the aircraft by rotating the aircraft anti-clockwise.
      Class Members:
      final MAX_ACTION_COUNT
      static final int MAX_ACTION_COUNT = 15
      Package:dji.common.mission.waypoint
      Description:

      Maximum number of actions a single waypoint can have. The maximum supported number is 15.

      final MAX_ACTION_REPEAT_TIMES
      static final int MAX_ACTION_REPEAT_TIMES = 15
      Package:dji.common.mission.waypoint
      Description:

      Maximum number of times a single waypoint action can be repeated. The maximum supported number is 15.