主要内容

Aero.trajectory.bezierTrajectory

Generate reference signals for Bezier trajectory

Since R2026a

Description

refSignals = Aero.trajectory.bezierTrajectory(Name=Value) generates reference signals for tracing Bezier trajectories. Use name-value arguments to define the Bezier curve. By default, Aero.trajectory.bezierTrajectory starts by defining a quadratic Bezier curve. The function automatically switches to define a cubic Bezier curve as needed. Function inputs and outputs are specified in the NED (North-East-Down) coordinate frame. For more information, see Algorithms.

example

Examples

collapse all

This example shows how to generate reference signals for a Bezier trajectory starting at [0,0] meters with a 90-degree initial heading, and ending at [50,50] meters.

refSignal = Aero.trajectory.bezierTrajectory(InitialPosition = [0,0], ...
    FinalPosition = [50,50],InitialHeading = pi/2, ...
    Altitude = 50,Speed = 1,Units = 'Metric (MKS)')
refSignal = struct with fields:
                 xNorth: [1×1 timeseries]
                  yEast: [1×1 timeseries]
                  Speed: [1×1 timeseries]
               Altitude: [1×1 timeseries]
                Heading: [1×1 timeseries]
          WaypointIndex: [1×1 timeseries]
    LateralAcceleration: [1×1 timeseries]

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: InitialPosition = [0,0]

Initial position of trajectory, specified as a 1-by-2 or 2-by-1 vector in the units specified in Units.

Example: InitialPosition = [0,0]

Data Types: double

Final position of trajectory, specified as a 1-by-2 or 2-by-1 vector in the units specified in Units.

Example: FinalPosition = [50,50]

Data Types: double

Initial heading of trajectory, specified as a real scalar between 0 and 2*pi, in radians. Specify at least one or both InitialHeading and FinalHeading.

Example: InitialHeading = pi

Data Types: double

Final heading of trajectory, specified as a finite real double scalar between 0 and 2*pi, in radians. Specify at least one or both InitialHeading and FinalHeading.

Example: FinalHeading = pi

Data Types: double

Speed of trajectory, specified as a finite real double scalar in the units specified in Units.

Example: Speed = 10

Data Types: double

Shape factor constant, specified as a 1-by-2 vector, 1-by-2 vector, or positive finite real double scalar between 0 and 10. The distance of the control points in the Bezier trajectory from the initial or final position is varied in proportion to the value of the shape factor. For more information, see Algorithms.

Example: ShapeFactor = 2

Data Types: double

Altitude of the vehicle trajectory, specified as a finite real scalar double in the units specified in Units. This value is constant throughout the vehicle path.

Example: Altitude = 10

Data Types: double

Number of samples in the output signals, specified as a scalar.

Example: NumberOfSamples = 10

Data Types: double

Reference signal type, specified as lateral-acceleration or turnrate.

Example: ReferenceSignalType = turnrate

Data Types: double

Initial time of trajectory operation, specified as a datetime object.

Example: StartTime=datetime('now')

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

Example: Units = 'Metric (MKS)'

Data Types: double

Output format of reference signals data, specified as timeseries or timetable.

Example: OutputFormat = timeseries

Prior trajectory tracking data, specified as a timeseries or timetable object. These objects must contain these fields:

  • Altitude

  • Heading

  • Speed

  • WaypointIndex

  • xNorth

  • yEast

  • LateralAcceleraion/Turnrate

Output Arguments

collapse all

Trajectory reference signals, returned as a timeseries struct or timetable object.

Algorithms

Use Aero.trajectory.bezierTrajectory to define these parameters of a bezier trajectory.

The general form of the Bezier trajectory used is

B(T)=i=0n(1T)niTiPi+1,

where the Pi+1s represent the control points as 2-by-1 vectors and B(T)=[x(T)y(T)] the position vector that traces the Bezier curve.

This logic is used to fit the Bezier trajectory.

  • A cubic Bezier curve has four control points. The initial position is set as the first control point P2, and the final position is set as the fourth control point P2.

  • The second control point P3 is defined along the direction of the initial heading, at a distance from the initial position. The first element of the shape factor determines this distance.

  • The third control point P4 is defined opposite to the direction of the final heading, at a distance from the final position. The second element of the shape factor determines this distance. If either the initial or final heading is not specified, the corresponding intermediate control point is omitted, resulting in a quadratic Bezier curve.

The reference signal is calculated using this logic:

  • Heading is determined from the tangent direction to the path.

  • Lateral acceleration and turn rate are computed from the radius of curvature (ρ) of the path using these equations:

    • Lateral acceleration: α = V2

    • Turn rate: ω = V/ρ, where V is the speed of the vehicle.

Version History

Introduced in R2026a