DJI Mobile SDK Documentation

      class DJIWaypointMission

      @interface DJIWaypointMission : DJIMission
      Header:DJIWaypointMission.h
      Inherits From:DJIMission
      Description:

      In the waypoint mission, the aircraft will travel between waypoints, execute actions at waypoints, and adjust heading and altitude between waypoints. Waypoints are physical locations to which the aircraft will fly. Creating a series of waypoints, in effect, will program a flight route for the aircraft to follow. Actions can also be added to waypoints, which will be carried out when the aircraft reaches the waypoint. The aircraft travels between waypoints automatically at a base speed. However, the user can change the speed by using the pitch joystick. If the stick is pushed up, the speed will increase. If the stick is pushed down, the speed will slow down. The stick can be pushed down to stop the aircraft and further pushed to start making the aircraft travel back along the path it came. When the aircraft is travelling through waypoints in the reverse order, it will not execute waypoint actions at each waypoint. If the stick is released, the aircraft will again travel through the waypoints in the original order, and continue to execute waypoint actions (even if executed previously). If the aircraft is pulled back along the waypoint mission all the way to the first waypoint, then it will hover in place until the stick is released enough for it to again progress through the mission from start to finish. It is not supported by Mavic Pro when using WiFi connection. It is not supported by Spark, Mavic Mini, DJI Mini 2, DJI Mini SE, Mavic Air 2, DJI Air 2S and Matrice 300 RTK.

      Class Members:
      enum DJIWaypointMissionExecuteState
      typedef NS_ENUM (uint8_t, DJIWaypointMissionExecuteState)
      Header:DJIWaypointMissionTypes.h
      Description:

      Current waypoint mission state.

      Enum Members:
      DJIWaypointMissionExecuteStateInitializingWaypoint mission is initializing, which means the mission has started and the aircraft is going to the first waypoint.
      DJIWaypointMissionExecuteStateMovingAircraft is currently moving toward the mission's next waypoint. This happens when the DJIWaypointMissionFlightPathMode is set to DJIWaypointMissionFlightPathNormal.
      DJIWaypointMissionExecuteStateCurveModeMovingAircraft is currently moving. This happens when the DJIWaypointMissionFlightPathMode is set to DJIWaypointMissionFlightPathCurved.
      DJIWaypointMissionExecuteStateCurveModeTurningAircraft is currently turning. This happens when the DJIWaypointMissionFlightPathMode is set to DJIWaypointMissionFlightPathCurved.
      DJIWaypointMissionExecuteStateBeginActionAircraft has reached a waypoint, has rotated to the new heading and is now processing actions. This state will be called before the waypoint actions starts executing and will occur for each waypoint action.
      DJIWaypointMissionExecuteStateDoingActionAircraft is at a waypoint and is executing an action.
      DJIWaypointMissionExecuteStateFinishedActionAircraft is at a waypoint and has finished executing the current waypoint action. This state occurs once for each waypoint action.
      DJIWaypointMissionExecuteStateReturnToFirstWaypointAircraft has returned to the first waypoint. This happens when the finishedAction is set to DJIWaypointMissionExecuteStateReturnToFirstWaypoint.
      DJIWaypointMissionExecuteStatePausedThe mission is currently paused by the user.
      enum DJIWaypointMissionFinishedAction
      typedef NS_ENUM (uint8_t, DJIWaypointMissionFinishedAction)
      Header:DJIWaypointMissionTypes.h
      Description:

      Actions taken when the waypoint mission has finished.

      Enum Members:
      DJIWaypointMissionFinishedNoActionNo further action will be taken on completion of mission. At this point, the aircraft can be controlled by the remote controller.
      DJIWaypointMissionFinishedGoHomeThe aircraft will go home when the mission is complete. If the aircraft is more than 20m away from the home point it will go home and land. Otherwise, it will land directly at the current location.
      DJIWaypointMissionFinishedAutoLandThe aircraft will land automatically at the last waypoint.
      DJIWaypointMissionFinishedGoFirstWaypointThe aircraft will go back to its first waypoint and hover in position.
      DJIWaypointMissionFinishedContinueUntilStopWhen the aircraft reaches its final waypoint, it will hover without ending the mission. The joystick can still be used to pull the aircraft back along its previous waypoints. The only way this mission can end is if stopMission is called.
      enum DJIWaypointMissionHeadingMode
      typedef NS_ENUM (NSUInteger, DJIWaypointMissionHeadingMode)
      Header:DJIWaypointMissionTypes.h
      Description:

      Current waypoint mission heading mode.

      Enum Members:
      DJIWaypointMissionHeadingAutoAircraft's heading will always be in the direction of flight.
      DJIWaypointMissionHeadingUsingInitialDirectionAircraft's heading will be set to the heading when reaching the first waypoint. Before reaching the first waypoint, the aircraft's heading can be controlled by the remote controller. When the aircraft reaches the first waypoint, its heading will be fixed.
      DJIWaypointMissionHeadingControlledByRemoteControllerAircraft's heading will be controlled by the remote controller.
      DJIWaypointMissionHeadingUsingWaypointHeadingAircraft will rotate its heading after the waypoint has been reached. You should use this interface heading to set aircraft heading.
      DJIWaypointMissionHeadingTowardPointOfInterestAfter the first waypoint has been reached, aircraft heading will always toward to the point of interest.
      enum DJIWaypointMissionFlightPathMode
      typedef NS_ENUM (NSUInteger, DJIWaypointMissionFlightPathMode)
      Header:DJIWaypointMissionTypes.h
      Description:

      Waypoint mission flight path mode.

      Enum Members:
      DJIWaypointMissionFlightPathNormalThe flight path will be normal and the aircraft will move from one waypoint to the next in straight lines.
      DJIWaypointMissionFlightPathCurvedThe flight path will be curved and the aircraft will move from one waypoint to the next in a curved motion, adhering to the cornerRadiusInMeters, which is set in DJIWaypoint.
      enum DJIWaypointMissionGotoWaypointMode
      typedef NS_ENUM (NSInteger, DJIWaypointMissionGotoWaypointMode)
      Header:DJIWaypointMissionTypes.h
      Description:

      This enum will determine the goto point mode while the drone executes the flight.

      Enum Members:
      DJIWaypointMissionGotoWaypointSafelyGo to the waypoint safely. The aircraft will rise to the same altitude of the waypoint if the current altitude is lower then the waypoint altitude. It then goes to the waypoint coordinate from the current altitude, and proceeds to the altitude of the waypoint.
      DJIWaypointMissionGotoWaypointPointToPointGo to the waypoint from the current aircraft point to the waypoint directly.
      Make Mission
      method
      method initWithMission
      -(instancetype)initWithMission:(DJIWaypointMission *)mission
      Header:DJIWaypointMission.h
      Description:

      Initialize a DJIWaypointMission by copying the parameters from the input mission.

      Input Parameters:
      DJIWaypointMission * missionMission to be copied from.
      method checkParameters
      - (nullable NSError *)checkParameters
      Header:DJIWaypointMission.h
      Description:

      Checks if the configuration for the mission is valid before loading it into DJIWaypointMissionOperator.

      Return:
      nullable NSError *Error found when checking parameters of the waypoint. nil if all the parameters are valid.
      Mission ID
      property
      property missionID
      @property(nonatomic, readonly) uint16_t missionID
      Header:DJIWaypointMission.h
      Description:

      The Mission ID.

      Waypoint Information
      property
      property waypointCount
      @property(nonatomic, readonly) NSUInteger waypointCount
      Header:DJIWaypointMission.h
      Description:

      Number of waypoints in the waypoint mission. Note there are some cases when the waypoint count will be different to the waypoint array length from allWaypoints. This is usually the case when the waypoint mission is still being downloaded from the aircraft and the mission object hasn't existed previously (e.g. when the mobile device is connected to an aircraft with a previously uploaded mission). In these cases, isComplete will return NO.

      method waypointAtIndex
      - (nullable DJIWaypoint *)waypointAtIndex:(NSUInteger)index
      Header:DJIWaypointMission.h
      Description:

      Gets the waypoint at the specified index in the mission waypoint array.

      Input Parameters:
      NSUInteger indexIndex of the waypoint to be retrieved.
      Return:
      nullable DJIWaypoint *The DJIWaypoint at the specified index.
      method allWaypoints
      - (NSArray<DJIWaypoint *> *)allWaypoints
      Header:DJIWaypointMission.h
      Description:

      Returns an array of all waypoints in the mission.

      Return:
      NSArray<DJIWaypoint *> *An array of DJIWaypoint instances contained in the mission.
      Flight Speed
      property
      property maxFlightSpeed
      @property(nonatomic, readonly) float maxFlightSpeed
      Header:DJIWaypointMission.h
      Description:

      While the aircraft is travelling between waypoints, you can offset its speed by using the throttle joystick on the remote controller. maxFlightSpeed 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, maxFlightSpeed] 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. maxFlightSpeed has a range of [2,15] m/s.

      property autoFlightSpeed
      @property(nonatomic, readonly) float autoFlightSpeed
      Header:DJIWaypointMission.h
      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 autoFlightSpeed >0: Actual speed is autoFlightSpeed + Joystick Speed (with combined max of maxFlightSpeed) If autoFlightSpeed =0: Actual speed is controlled only by the remote controller joystick. If autoFlightSpeed <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.

      Start Mission behavior
      property
      property gotoFirstWaypointMode
      @property(nonatomic, readonly) DJIWaypointMissionGotoWaypointMode gotoFirstWaypointMode
      Header:DJIWaypointMission.h
      Description:

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

      See Also:

      DJIWaypointMissionGotoWaypointMode

      End Mission Behavior
      property
      property finishedAction
      @property(nonatomic, readonly) DJIWaypointMissionFinishedAction finishedAction
      Header:DJIWaypointMission.h
      Description:

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

      See Also:

      DJIWaypointMissionFinishedAction

      Aircraft Heading
      property
      property headingMode
      @property(nonatomic, readonly) DJIWaypointMissionHeadingMode headingMode
      Header:DJIWaypointMission.h
      Description:

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

      See Also:

      DJIWaypointMissionHeadingMode

      property pointOfInterest
      @property(nonatomic, readonly) CLLocationCoordinate2D pointOfInterest
      Header:DJIWaypointMission.h
      Description:

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

      Flight Path
      property
      property flightPathMode
      @property(nonatomic, readonly) DJIWaypointMissionFlightPathMode flightPathMode
      Header:DJIWaypointMission.h
      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.

      See Also:

      DJIWaypointMissionFlightPathMode

      Connection Lost
      property
      property exitMissionOnRCSignalLost
      @property(nonatomic, readonly) BOOL exitMissionOnRCSignalLost
      Header:DJIWaypointMission.h
      Description:

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

      Gimbal
      property
      property rotateGimbalPitch
      @property(nonatomic, readonly) BOOL rotateGimbalPitch
      Header:DJIWaypointMission.h
      Description:

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

      Repeat Mission
      property
      property repeatTimes
      @property(nonatomic, readonly) int repeatTimes
      Header:DJIWaypointMission.h
      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 stopMissionWithCompletion is called or any error occurs. Other values represent the exact execution times of the mission.

      Mission Download
      property
      property isComplete
      @property(nonatomic, readonly) BOOL isComplete
      Header:DJIWaypointMission.h
      Description:

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

      Mutable Copy
      method
      method mutableCopy
      - (DJIMutableWaypointMission *)mutableCopy
      Header:DJIWaypointMission.h
      Description:

      Creates a mutable copy of the mission.

      Return:
      DJIMutableWaypointMission *A mutable copy of the mission.