DJI Mobile SDK Documentation

      class Builder

      static class Builder
      Package:dji.common.mission.waypoint
      Description:

      Class builder.

      Class Members:
      Constructor
      method
      method Builder
      Builder()
      Package:dji.common.mission.waypoint
      Description:

      Default constructor of waypoint mission with 0 waypoints.

      method
      method Builder
      Builder(WaypointMission waypointMissionToClone)
      Package:dji.common.mission.waypoint
      Description:

      Waypoint mission constructor that clones this waypoint mission from another.

      Input Parameters:
      WaypointMission waypointMissionToCloneWaypoint mission to clone
      Waypoints
      method
      method addWaypoint
      Builder addWaypoint(@NonNull Waypoint waypoint)
      Package:dji.common.mission.waypoint
      Description:

      Add a waypoint to the waypoint mission.

      Input Parameters:
      @NonNull Waypoint waypointWaypoint to add.
      Return:
      BuilderA Builder object
      method removeWaypoint
      Builder removeWaypoint(@NonNull Waypoint waypoint)
      Package:dji.common.mission.waypoint
      Description:

      Remove a waypoint from the waypoint mission.

      Input Parameters:
      @NonNull Waypoint waypointWaypoint to remove.
      Return:
      BuilderA Builder object
      method removeWaypoint
      Builder removeWaypoint(@NonNull int index)
      Package:dji.common.mission.waypoint
      Description:

      Remove a waypoint by index from the waypoint mission.

      Input Parameters:
      @NonNull int indexIndex of waypoint to remove.
      Return:
      BuilderA Builder object
      method getWaypointList
      List<Waypoint> getWaypointList()
      Package:dji.common.mission.waypoint
      Description:

      List of waypoints that will define this mission

      Return:
      List<Waypoint>List of waypoints
      method insertWaypoint
      Builder insertWaypoint(@NonNull Waypoint waypoint, int index)
      Package:dji.common.mission.waypoint
      Description:

      Insert a waypoint to the waypoint mission.

      Input Parameters:
      @NonNull Waypoint waypointWaypoint to insert.
      int indexindex to insert the waypoint.
      Return:
      BuilderA Builder object
      method waypointCount
      Builder waypointCount(int waypointCount)
      Package:dji.common.mission.waypoint
      Description:

      Number of waypoints in the waypoint mission. This must be set to the correct number of waypoints added to the mission.

      Input Parameters:
      int waypointCountWaypoint count.
      Return:
      BuilderA Builder object
      method getWaypointCount
      int getWaypointCount()
      Package:dji.common.mission.waypoint
      Description:

      Number of waypoints in the waypoint mission.

      Return:
      intWaypoint count.
      Waypoint
      method
      method waypointList
      @Deprecated
      Builder waypointList(
      @NonNull @Size(max = MAX_WAYPOINT_COUNT, min = MIN_WAYPOINT_COUNT) List<Waypoint> waypointList)
      Package:dji.common.mission.waypoint
      Description:

      List of waypoints that will define this mission

      Input Parameters:
      @NonNull @Size(max = MAX_WAYPOINT_COUNT, min = MIN_WAYPOINT_COUNT) List<Waypoint> waypointListList of waypoints
      Return:
      BuilderA Builder object
      Mission ID
      method
      method getMissionID
      int getMissionID()
      Package:dji.common.mission.waypoint
      Description:

      Get mission id.

      Return:
      intMission id.
      method setMissionID
      Builder setMissionID(@IntRange(from = 0, to = 65535) int id)
      Package:dji.common.mission.waypoint
      Description:

      Set mission id.

      Input Parameters:
      @IntRange(from = 0, to = 65535) int idThe id of mission. The valid range is [0, 65535].
      Return:
      BuilderA Builder object.
      method calculateTotalDistance
      float calculateTotalDistance()
      Package:dji.common.mission.waypoint
      Description:

      Calculate the total distance of the waypoint list.

      Return:
      floatThe total distance of the waypoint list.
      method getLastCalculatedTotalDistance
      float getLastCalculatedTotalDistance()
      Package:dji.common.mission.waypoint
      Description:

      Get the last calculated total distance of the waypoint list.

      Return:
      floatThe last calculated total distance of the waypoint list.
      method calculateTotalTime
      Float calculateTotalTime()
      Package:dji.common.mission.waypoint
      Description:

      Calculate the total time of the waypoint list.

      Return:
      FloatThe total time of the waypoint list.
      method getLastCalculatedTotalTime
      Float getLastCalculatedTotalTime()
      Package:dji.common.mission.waypoint
      Description:

      Get the last calculated total time of the waypoint list.

      Return:
      FloatThe last calculated total time of the waypoint list.
      Flight Speed
      method
      method maxFlightSpeed
      Builder maxFlightSpeed(
      @FloatRange(from = MIN_FLIGHT_SPEED, to = MAX_FLIGHT_SPEED) float maxFlightSpeed)
      Package:dji.common.mission.waypoint
      Description:

      While the aircraft is travelling between waypoints, you can offset its speed by using the throttle joystick on the remote controller. getMaxFlightSpeed is this offset when the joystick is pushed to maximum deflection. For example, If maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up will add 10 m/s to the aircraft speed, while pushing down will subtract 10 m/s from the aircraft speed. If the remote controller stick is not at maximum deflection, then the offset speed will be interpolated between [0, getMaxFlightSpeed] with a resolution of 1000 steps. If the offset speed is negative, then the aircraft will fly backwards to previous waypoints. When it reaches the first waypoint, it will then hover in place until a positive speed is applied. getMaxFlightSpeed has a range of [2,15] m/s.

      Input Parameters:
      @FloatRange(from = MIN_FLIGHT_SPEED, to = MAX_FLIGHT_SPEED) float maxFlightSpeedFlight speed in m/s
      Return:
      BuilderA Builder object
      method getMaxFlightSpeed
      float getMaxFlightSpeed()
      Package:dji.common.mission.waypoint
      Description:

      While the aircraft is travelling between waypoints, you can offset its speed by using the throttle joystick on the remote controller. getMaxFlightSpeed is this offset when the joystick is pushed to maximum deflection. For example, If maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up will add 10 m/s to the aircraft speed, while pushing down will subtract 10 m/s from the aircraft speed. If the remote controller stick is not at maximum deflection, then the offset speed will be interpolated between [0, getMaxFlightSpeed] with a resolution of 1000 steps. If the offset speed is negative, then the aircraft will fly backwards to previous waypoints. When it reaches the first waypoint, it will then hover in place until a positive speed is applied. getMaxFlightSpeed has a range of [2,15] m/s.

      Return:
      floatFlight speed in m/s
      method autoFlightSpeed
      Builder autoFlightSpeed(
      @FloatRange(from = MIN_AUTO_FLIGHT_SPEED, to = MAX_AUTO_FLIGHT_SPEED) float autoFlightSpeed)
      Package:dji.common.mission.waypoint
      Description:

      The base automatic speed of the aircraft as it moves between waypoints with range [-15, 15] m/s. The aircraft's actual speed is a combination of the base automatic speed, and the speed control given by the throttle joystick on the remote controller. If getAutoFlightSpeed >0: Actual speed is getAutoFlightSpeed + Joystick Speed (with combined max of getMaxFlightSpeed) If getAutoFlightSpeed =0: Actual speed is controlled only by the remote controller joystick. If getAutoFlightSpeed <0 and the aircraft is at the first waypoint, the aircraft will hover in place until the speed is made positive by the remote controller joystick.

      Input Parameters:
      @FloatRange(from = MIN_AUTO_FLIGHT_SPEED, to = MAX_AUTO_FLIGHT_SPEED) float autoFlightSpeedFlight speed in m/s
      Return:
      BuilderA Builder object
      method getAutoFlightSpeed
      float getAutoFlightSpeed()
      Package:dji.common.mission.waypoint
      Description:

      The base automatic speed of the aircraft as it moves between waypoints with range [-15, 15] m/s. The aircraft's actual speed is a combination of the base automatic speed, and the speed control given by the throttle joystick on the remote controller. If getAutoFlightSpeed >0: Actual speed is getAutoFlightSpeed + Joystick Speed (with combined max of getMaxFlightSpeed) If getAutoFlightSpeed =0: Actual speed is controlled only by the remote controller joystick. If getAutoFlightSpeed <0 and the aircraft is at the first waypoint, the aircraft will hover in place until the speed is made positive by the remote controller joystick.

      Return:
      floatFlight speed in m/s
      Start Mission Behavior
      method
      method gotoFirstWaypointMode
      Builder gotoFirstWaypointMode(@NonNull WaypointMissionGotoWaypointMode gotoFirstWaypointMode)
      Package:dji.common.mission.waypoint
      Description:

      Defines how the aircraft will go to the first waypoint from its current position. Default is SAFELY.

      Input Parameters:
      @NonNull WaypointMissionGotoWaypointMode gotoFirstWaypointModeBehavior prior to mission start.
      Return:
      BuilderA Builder object
      method getGotoFirstWaypointMode
      WaypointMissionGotoWaypointMode getGotoFirstWaypointMode()
      Package:dji.common.mission.waypoint
      Description:

      Defines how the aircraft will go to the first waypoint from its current position. Default is SAFELY.

      Return:
      WaypointMissionGotoWaypointModeThe behavior of the aircraft at the begining of the mission
      End Mission Behvaior
      method
      method finishedAction
      Builder finishedAction(@NonNull WaypointMissionFinishedAction finishedAction)
      Package:dji.common.mission.waypoint
      Description:

      Action the aircraft will take when the waypoint mission is complete.

      Input Parameters:
      @NonNull WaypointMissionFinishedAction finishedActionBehavior of aircraft when mission is complete.
      Return:
      BuilderA Builder object
      method getFinishedAction
      WaypointMissionFinishedAction getFinishedAction()
      Package:dji.common.mission.waypoint
      Description:

      Action the aircraft will take when the waypoint mission is complete.

      Return:
      WaypointMissionFinishedActionThe action to execute when the waypoint mission finishes
      Aircraft Heading
      method
      method headingMode
      Builder headingMode(@NonNull WaypointMissionHeadingMode headingMode)
      Package:dji.common.mission.waypoint
      Description:

      Heading of the aircraft as it moves between waypoints. Default is AUTO.

      Input Parameters:
      @NonNull WaypointMissionHeadingMode headingModeThe heading mode.
      Return:
      BuilderA Builder object
      method getHeadingMode
      WaypointMissionHeadingMode getHeadingMode()
      Package:dji.common.mission.waypoint
      Description:

      Heading of the aircraft as it moves between waypoints. Default is AUTO.

      Return:
      WaypointMissionHeadingModeHeading mode.
      method setPointOfInterest
      Builder setPointOfInterest(@NonNull LocationCoordinate2D pointOfInterest)
      Package:dji.common.mission.waypoint
      Description:

      Aircraft heading will be fixed to the point of interest location during the waypoint mission. Used when getHeadingMode is TOWARD_POINT_OF_INTEREST.

      Input Parameters:
      @NonNull LocationCoordinate2D pointOfInterestPoint of interest location.
      Return:
      BuilderA Builder object
      method getPointOfInterest
      LocationCoordinate2D getPointOfInterest()
      Package:dji.common.mission.waypoint
      Description:

      Aircraft heading will be fixed to the point of interest location during the waypoint mission. Used when getHeadingMode is TOWARD_POINT_OF_INTEREST.

      Return:
      LocationCoordinate2DPoint of interest location.
      Flight Path
      method
      method flightPathMode
      Builder flightPathMode(@NonNull WaypointMissionFlightPathMode flightPathMode)
      Package:dji.common.mission.waypoint
      Description:

      The path the aircraft follows between waypoints. The aircraft can either fly directly between waypoints in a straight line, or turn near a waypoint in the curve where the waypoint location defines a part of the curve.

      Input Parameters:
      @NonNull WaypointMissionFlightPathMode flightPathModeThe flight path mode.
      Return:
      BuilderA Builder object
      method getFlightPathMode
      WaypointMissionFlightPathMode getFlightPathMode()
      Package:dji.common.mission.waypoint
      Description:

      The path the aircraft follows between waypoints. The aircraft can either fly directly between waypoints in a straight line, or turn near a waypoint in the curve where the waypoint location defines a part of the curve.

      Return:
      WaypointMissionFlightPathModeThe flight path mode.
      method setExitMissionOnRCSignalLostEnabled
      Builder setExitMissionOnRCSignalLostEnabled(boolean enabled)
      Package:dji.common.mission.waypoint
      Description:

      Determines whether the mission should stop when connection between the aircraft and remote controller is lost. Default is false.

      Input Parameters:
      boolean enabledtrue if mission should stop when connection is lost.
      Return:
      BuilderA Builder object
      method isExitMissionOnRCSignalLostEnabled
      boolean isExitMissionOnRCSignalLostEnabled()
      Package:dji.common.mission.waypoint
      Description:

      Determines whether the mission should stop when connection between the aircraft and remote controller is lost. Default is false.

      Return:
      booleantrue if mission should stop when connection is lost.
      method setGimbalPitchRotationEnabled
      Builder setGimbalPitchRotationEnabled(boolean gimbalPitchRotationEnabled)
      Package:dji.common.mission.waypoint
      Description:

      true if the gimbal pitch rotation can be controlled during the waypoint mission. When true, gimbalPitch in Waypoint is used to control gimbal pitch.

      Input Parameters:
      boolean gimbalPitchRotationEnabledtrue if gimbal pitch can be controlled.
      Return:
      BuilderA Builder object
      method isGimbalPitchRotationEnabled
      boolean isGimbalPitchRotationEnabled()
      Package:dji.common.mission.waypoint
      Description:

      true if the gimbal pitch rotation can be controlled during the waypoint mission. When true, gimbalPitch in Waypoint is used to control gimbal pitch.

      Return:
      booleantrue if gimbal pitch can be controlled.
      Repeat Mission
      method
      method repeatTimes
      Builder repeatTimes(@IntRange(from = MIN_REPEAT_TIME, to = MAX_REPEAT_TIME) int repeatTimes)
      Package:dji.common.mission.waypoint
      Description:

      Mission execution can be repeated more than once. The value range is [1, 255]. If 255 is selected, then the mission will continue to be executed until stopMission is called or any error occurs. Other values represent the exact execution times of the mission.

      Input Parameters:
      @IntRange(from = MIN_REPEAT_TIME, to = MAX_REPEAT_TIME) int repeatTimesNumber of times to repeat mission, the value should be larger than 0.
      Return:
      BuilderA Builder object
      method getRepeatTimes
      int getRepeatTimes()
      Package:dji.common.mission.waypoint
      Description:

      Gets the repeat times of the mission builder.

      Return:
      intNumber of times to repeat mission.
      Mission Download
      method
      method isMissionComplete
      boolean isMissionComplete()
      Package:dji.common.mission.waypoint
      Description:

      When downloading a waypoint mission, the number of waypoints in getWaypointList will be less than getWaypointCount until the download is complete. This property is true when all the information in the waypoint mission is downloaded, and complete in this object.

      Return:
      booleantrue if mission information is complete.
      Build
      method
      method build
      WaypointMission build()
      Package:dji.common.mission.waypoint
      Description:

      Build the object into a WaypointMission object.

      Return:
      WaypointMissionWaypoint mission.