Main Content

parse

Generate trajectory in local NED frame

    Description

    example

    traj = parse(parser,mission) generates a reference trajectory traj for a multirotor or fixed-wing UAV following the mission mission. The parse function generates the reference trajectory in a local north-east-down (NED) frame with its origin at the global coordinates specified by the HomeLocation property of mission.

    traj = parse(parser,mission,refLocation) generates the reference trajectory in a local NED frame with its origin defined by the global coordinates refLocation.

    Examples

    collapse all

    Create a UAV mission by using the flight plan stored in a .plan file and show the mission.

    mission = uavMission(PlanFile="flight.plan");
    show(mission);

    Figure contains an axes object. The axes object contains 10 objects of type line, text.

    Create parsers for a multirotor UAV and a fixed-wing UAV.

    mrmParser = multirotorMissionParser(TransitionRadius=2,TakeoffSpeed=2);
    fwmParser = fixedwingMissionParser(TransitionRadius=15,TakeoffPitch=10);

    Generate one flight trajectory using each parser.

    mrmTraj = parse(mrmParser,mission);
    fwmTraj = parse(fwmParser,mission);

    Visualize the mission and the flight trajectories separately.

    figure
    subplot(1,2,1)
    show(mrmTraj);
    title("Multirotor Trajectory")
    axis square
    subplot(1,2,2)
    show(fwmTraj);
    title("Fixed-Wing Trajectory")
    axis square

    Figure contains 2 axes objects. Axes object 1 with title Multirotor Trajectory contains 501 objects of type patch, line. Axes object 2 with title Fixed-Wing Trajectory contains 428 objects of type patch, line.

    Plot the mission and flight trajectories overlapping.

    figure
    show(mission);
    hold on
    show(mrmTraj);
    hold off
    title("Mission Using Multirotor Trajectory")
    axis square

    Figure contains an axes object. The axes object with title Mission Using Multirotor Trajectory contains 511 objects of type patch, line, text.

    show(mission);
    hold on
    show(fwmTraj);
    hold off
    title("Mission Using Fixed-Wing Trajectory")
    axis square

    Figure contains an axes object. The axes object with title Mission Using Fixed-Wing Trajectory contains 438 objects of type patch, line, text.

    Input Arguments

    collapse all

    UAV mission parser, specified as a multirotorMissionParser object or a fixedwingMissionParser object.

    UAV mission, specified as a uavMission object.

    Reference location, specified as a three-element row vector of the form [latitude longitude altitude], representing global coordinates. latitude and longitude are in degrees. altitude is the height in meters above the WGS84 ellipsoid.

    Example: parse(parser,mission,[20 40.1 72])

    Output Arguments

    collapse all

    Trajectory, returned as a multirotorFlightTrajectory object for multirotorMissionParser objects and fixedwingFlightTrajectory object for fixedwingMissionParser objects.

    Version History

    Introduced in R2022b