Main Content


Add takeoff mission item

Since R2022b


    addTakeoff(mission,altitude) adds a takeoff mission item that commands a UAV to takeoff and ascend to the specified altitude altitude.


    addTakeoff(___,Name=Value) sets additional options specified by one or more name-value pair arguments in addition to all input arguments from the previous syntax. For example, addTakeoff(mission,altitude,Frame="LocalNED") adds a takeoff mission item with the altitude specified in the local north-east-down (NED) reference frame.


    collapse all

    Create a UAV mission object with a home location at the origin of the local ENU coordinate frame and an initial speed of 5 meters per second.

    m = uavMission(Frame="LocalENU",HomeLocation=[0 0 0],Speed=5)
    m = 
      uavMission with properties:
           HomeLocation: [0 0 0]
             InitialYaw: 0
                  Frame: "LocalENU"
                  Speed: 5
        NumMissionItems: 0

    Add a takeoff mission item to the mission with an altitude of 25 meters, pitch of 15 degrees, and yaw of 0 degrees.


    Add two waypoint mission items to the mission. Between the two waypoints, increase the speed of the UAV to 20 meters per second. After the second waypoint, reduce the speed of the UAV back to 5 meters per second.

    addWaypoint(m,[10 0 30]);
    addWaypoint(m,[20 0 40]);
    addWaypoint(m,[30 0 50])

    Add loiter and hover mission items to the mission, specifying for the UAV to loiter and hover around the second waypoint at a radius of 50 meters for 20 seconds each.

    addLoiter(m,[40 0 60],10,20);
    addHover(m,[50 0 70],10,20);

    Add a landing mission item to the mission to land the UAV.

    addLand(m,[70 0 0],Yaw=0);

    Show the mission item data table.


    Remove the hover action at index 7, and then add another waypoint at index 8 after the hover item moves to index 7. Show the mission details table again to see the changes.

    addWaypoint(m,[65 0 70],InsertAtRow=8);

    Visualize the mission.

    axis equal

    Input Arguments

    collapse all

    UAV mission, specified as a uavMission object.

    Desired altitude, specified as a numeric scalar, in meters.

    If the mission waypoint reference frame is Global, this value specifies an absolute altitude above the WGS84 reference ellipsoid. Otherwise, this value specifies altitude relative to the home location of the mission.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: addTakeoff(mission,5,Pitch=15,Frame="LocalNED")

    Desired pitch, specified as a nonnegative numeric scalar, in degrees.

    Data Types: double

    Desired yaw, specified as a numeric scalar, in degrees.

    Mission waypoint reference frame, specified as one of these values:

    • "Global" — Global reference frame

    • "GlobalRelativeAlt" — Global reference frame with an altitude relative to the home location specified by mission

    • "LocalENU" — Local east-north-up (ENU) reference frame

    • "LocalNED" — Local north-east-down (NED) reference frame

    If you do not specify the Frame argument, addTakeoff uses the reference frame of the uavMission object mission.

    Data Types: char | string

    Timestamp of this item, specified as a numeric scalar, in seconds.

    If you do not specify the Timestamp argument, addTakeoff determines the timestamp automatically based on the reference speed of the uavMission object.

    Item position in the mission order, specified as an positive integer.

    If you do not specify the Timestamp argument or you specify a value that is greater than the total number of items in the mission, the item is inserted after the last item as the next index value.

    Version History

    Introduced in R2022b