주요 콘텐츠

Aero.trajectory.merge

R2026b

Merge two trajectories into a single unified trajectory with a smooth transition

Since R2026b

Description

combinedTrajectory = Aero.trajectory.merge(trajectory1,trajectory2,transition) merges two trajectory signals into a single unified trajectory using the specified transition trajectory type to smoothly connect the endpoints. The function can handle trajectories that differ in data types, unit systems, and time alignment, which makes it useful for working with pre-existing trajectories.

The Aero.trajectory.merge function combines two discontinuous trajectories, from Aero.trajectory.sectorTrajectory and Aero.trajectory.parallelSweepTrajectory, together. To smooth the transition between the two trajectories, the function uses a continuous trajectory as a bridge or transition.

Consider merging trajectories when working with existing trajectories rather than parametric trajectory definitions. The Aero.trajectory.merge function handles the complexity of connecting existing trajectories while managing discontinuities and ensuring smooth transitions between the two trajectories.

When the input trajectories differ in output format or unit system, the Aero.trajectory.merge function normalizes the inputs to a common structure and applies unit conversion as needed before merging. Define both input trajectories in the flat coordinate plane.

combinedTrajectory = Aero.trajectory.merge(___,Name=Value) specifies additional options using one or more name-value arguments.

example

Examples

collapse all

This example shows how to merge two flight trajectories using the Aero.trajectory.merge function. It creates a circular trajectory and a polyline trajectory with a spatial gap between them, then merges them using a bezier connection curve to produce a single continuous flight path.

To create trajectory 1 as a circular arc from [0,0] to [50,50], use the Aero.trajectory.circularTrajectory function.

traj1 = Aero.trajectory.circularTrajectory( ...
    InitialPosition=[0, 0], ...
    FinalPosition=[50, 50], ...
    InitialHeading=pi/2, ...
    Speed=15, ...
    Altitude=100, ...
    NumberOfSamples=20)
traj1 = struct with fields:
                 xNorth: [1×1 timeseries]
                  yEast: [1×1 timeseries]
                  Speed: [1×1 timeseries]
               Altitude: [1×1 timeseries]
                Heading: [1×1 timeseries]
        FlightPathAngle: [1×1 timeseries]
          WaypointIndex: [1×1 timeseries]
    LateralAcceleration: [1×1 timeseries]

To create trajectory 2 as a polyline starting from [100,100], use the Aero.trajectory.polylineTrajectory function. There is a gap between the traj1 endpoint [50,50] and the traj2 start [100,100].

traj2 = Aero.trajectory.polylineTrajectory( ...
    InitialPosition=[100, 100], ...
    AbsoluteBearing=pi/6, ...
    Speed=20, ...
    Altitude=100, ...
    SegmentDistance=120)
traj2 = struct with fields:
             xNorth: [1×1 timeseries]
              yEast: [1×1 timeseries]
              Speed: [1×1 timeseries]
           Altitude: [1×1 timeseries]
            Heading: [1×1 timeseries]
    FlightPathAngle: [1×1 timeseries]
      WaypointIndex: [1×1 timeseries]

To merge the two trajectories with a bezier connection, use the Aero.trajectory.merge function.

mergedTraj = Aero.trajectory.merge(traj1,traj2,"bezier")
mergedTraj = struct with fields:
                 xNorth: [1×1 timeseries]
                  yEast: [1×1 timeseries]
                  Speed: [1×1 timeseries]
               Altitude: [1×1 timeseries]
                Heading: [1×1 timeseries]
        FlightPathAngle: [1×1 timeseries]
          WaypointIndex: [1×1 timeseries]
    LateralAcceleration: [1×1 timeseries]

Input Arguments

collapse all

First input trajectory, specified as a reference signal for sector search or parallel sweep search trajectory. The trajectory can be in timeseries or timetable format. The initial position, initial heading, and time entries of the transition trajectory derive from the terminal point of this trajectory. The transition trajectory uses the speed of this trajectory.

Second input trajectory, specified as a reference signal for sector search or parallel sweep search trajectory. The trajectory can be in timeseries or timetable format. The final position and final heading of the transition trajectory derive from the initial point of this trajectory.

Transition trajectory type, specified as "bezier", "circular", or "polynomial".

Name-Value Arguments

collapse all

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: ShapeFactor = 0.5

Shape factor constant for the transition trajectory, specified as a positive finite real double scalar between 0 and 1. This parameter controls the shape of the transition curve.

Example: ShapeFactor = 0.5

Data Types: double

Number of samples for the transition trajectory, specified as a positive integer scalar.

Example: NumberOfSamples = 100

Data Types: double

Maximum turn radius for the transition trajectory, specified as a positive finite real double scalar. This parameter applies when the transition type is "circular".

Example: MaximumTurnRadius = 10

Dependencies

To enable this name-value argument, specify the transition argument as circular.

Data Types: double

Minimum turn radius for the transition trajectory, specified as a positive finite real double scalar.

Example: MinimumTurnRadius = 2

Dependencies

To enable this name-value argument, specify the transition argument as circular.

Data Types: double

Output format of the combined trajectory, specified as "timeseries" or "timetable".

If not specified, the function uses the output format of trajectory1. If trajectory1 is a timetable, the output is a timetable. If it is a struct (timeseries), the output is a timeseries.

Example: OutputFormat = "timetable"

Data Types: string

Input and output units, specified as one of these values:

Units

Position

Altitude

Speed

Metric (MKS)

Meters

Meters

Meters per second

English (Velocity in ft/s)

Feet

Feet

Feet per second

English (Velocity in kts)

Nautical miles

Feet

Knots

If you do not specify a unit system, the function uses the unit system of trajectory1. Unit conversion is applied automatically when the input trajectories use different unit systems.

Example: Units = "Metric (MKS)"

Reference signal type, specified as lateral-acceleration or turnrate. Depending on the selection, either lateral acceleration or turn rate is included as an additional reference signal. A reference signal is a predefined, desired path or sequence of positions, velocities, or attitudes (orientations) that aerospace vehicles are intended to follow over time.

Example: ReferenceSignalType="turnrate"

Output Arguments

collapse all

Combined trajectory reference signals, returned as a timeseries or timetable object. The output contains the merged reference signals from trajectory1, the transition trajectory, and trajectory2, concatenated in sequence. The output includes position, speed, altitude, heading, flight path angle, and reference signals (lateral acceleration or turn rate). The time entries follow trajectory1, and the transition trajectory uses the speed of trajectory1.

If the altitudes of the two input trajectories differ at the merge point, the function automatically inserts a polyline trajectory segment to transition between the altitudes before the transition trajectory.

Algorithms

The Aero.trajectory.merge function combines two discontinuous trajectories into a single unified trajectory by inserting a continuous transition trajectory between them. The algorithm follows:

  1. Normalize input — When the input trajectories differ in output format (timeseries vs. timetable) or unit system (Metric, English ft/s, English kts), the function normalizes both inputs to a common structure and applies unit conversion as needed before merging.

  2. Create transition trajectory — The function creates a continuous transition trajectory (Bezier, circular, or polynomial) that acts as a bridge between the two input trajectories. The transition trajectory derives its initial position and initial heading from the end of trajectory1, and its final position and final heading from the initial point of trajectory2. The transition trajectory uses the speed of trajectory1.

  3. Handle altitude transition — If the altitudes of the two input trajectories differ at the merge point, the function automatically inserts a polyline trajectory segment to transition between the altitudes before the transition trajectory.

  4. Align time — The time entries of the combined trajectory follow trajectory1. The function computes the transition trajectory timing using the speed of trajectory1.

  5. Concatenate reference signals — The function concatenates the reference signals from trajectory1, the transition trajectory (and any altitude transition segment), and trajectory2 in sequence to produce the final combined trajectory output.

Note

If the endpoint of trajectory1 coincides with the initial point of trajectory2, the function returns an error when the transition type is "bezier" or "polynomial". A "circular" transition can connect coincident endpoints.

Version History

Introduced in R2026b