DJI Mobile SDK Documentation

      class Builder

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

      This class is used for the developer to build the WaypointV2Mission.

      Class Members:
      Set Mission ID
      method
      method setMissionID
      Builder setMissionID(long missionID)
      Package:dji.common.mission.waypointv2
      Description:

      Set Mission ID.

      Input Parameters:
      long missionIDThe value of missionID to set.
      Return:
      BuilderThe build of Builder.
      Set Max Flight Speed
      method
      method setMaxFlightSpeed
      Builder setMaxFlightSpeed(float maxFlightSpeed)
      Package:dji.common.mission.waypointv2
      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:
      float maxFlightSpeedThe value of the max flight speed.
      Return:
      BuilderThe build of Builder.
      Set Auto Flight Speed
      method
      method setAutoFlightSpeed
      Builder setAutoFlightSpeed(float autoFlightSpeed)
      Package:dji.common.mission.waypointv2
      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:
      float autoFlightSpeedThe value of the auto flight speed.
      Return:
      BuilderThe build of Builder.
      Set Finished Action
      method
      method setFinishedAction
      Builder setFinishedAction(MissionFinishedAction finishedAction)
      Package:dji.common.mission.waypointv2
      Description:

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

      Input Parameters:
      MissionFinishedAction finishedActionThe enum value of MissionFinishedAction.
      Return:
      BuilderThe build of Builder.
      Set Go To First Waypoint Mode
      method
      method setGotoFirstWaypointMode
      Builder setGotoFirstWaypointMode(MissionGotoWaypointMode gotoFirstWaypointMode)
      Package:dji.common.mission.waypointv2
      Description:

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

      Input Parameters:
      MissionGotoWaypointMode gotoFirstWaypointModeThe enum value of MissionFinishedAction.
      Return:
      BuilderThe build of Builder.
      Set Exit Mission On RC Signal Lost
      method
      method setExitMissionOnRCSignalLostEnabled
      Builder setExitMissionOnRCSignalLostEnabled(boolean exitMissionOnRCSignalLostEnabled)
      Package:dji.common.mission.waypointv2
      Description:

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

      Input Parameters:
      boolean exitMissionOnRCSignalLostEnabledA boolean value.
      Return:
      BuilderThe build of Builder.
      Set Repeat Times
      method
      method setRepeatTimes
      Builder setRepeatTimes(int repeatTimes)
      Package:dji.common.mission.waypointv2
      Description:

      Repeat times for mission execution. Default is 1.

      Input Parameters:
      int repeatTimesAn int value of mission repeat times.
      Return:
      BuilderThe build of Builder.
      Add Waypoints
      method
      method addwaypoints
      Builder addwaypoints(@NonNull List<WaypointV2> waypointList)
      Package:dji.common.mission.waypointv2
      Description:

      Adds an array of waypoints to the waypoint mission. When the waypoints are added successfully, getWaypointCount will increment by the number of added waypoints.

      Input Parameters:
      @NonNull List<WaypointV2> waypointListA list of WaypointV2 objects.
      Return:
      BuilderThe build of Builder.
      Add Waypoint
      method
      method addWaypoint
      Builder addWaypoint(@NonNull WaypointV2 waypoint)
      Package:dji.common.mission.waypointv2
      Description:

      As same as Waypoint 1.0 Add a waypoint to the waypoint mission. When a waypoint is added successfully, getWaypointCount will increment by 1. A waypoint will only be valid if the distance (in three dimensions) between two adjacent waypoints is in range [0.5,2000] meters.

      Input Parameters:
      @NonNull WaypointV2 waypointA WaypointV2 object.
      Return:
      BuilderThe build of Builder.
      Remove Waypoint
      method
      method removeWaypoint
      Builder removeWaypoint(@NonNull WaypointV2 waypoint)
      Package:dji.common.mission.waypointv2
      Description:

      As same as Waypoint 1.0, removes the last waypoint stored in the mission. When the waypoint is removed successfully, getWaypointCount will decrease by 1.

      Input Parameters:
      @NonNull WaypointV2 waypointA WaypointV2 object.
      Return:
      BuilderThe build of Builder.
      Remove Waypoint By Index
      method
      method removeWaypoint
      Builder removeWaypoint(@NonNull int index)
      Package:dji.common.mission.waypointv2
      Description:

      As same as Waypoint 1.0, removes the last waypoint stored in the mission. When the waypoint is removed successfully, getWaypointCount will decrease by 1.

      Input Parameters:
      @NonNull int indexThe index of the waypoint.
      Return:
      BuilderThe build of Builder.
      Waypoint V2 Mission Builder
      method
      method build
      WaypointV2Mission build()
      Package:dji.common.mission.waypointv2
      Description:

      Build a WaypointV2Mission object.

      Return:
      WaypointV2MissionThe object of WaypointV2Mission.