Waypoint trajectory generator
The waypointTrajectory
System object™ generates trajectories using specified waypoints. When you create the
System object, you can optionally specify the time of arrival, velocity, and orientation at
each waypoint. See Algorithms for more details.
To generate a trajectory from waypoints:
Create the waypointTrajectory object and set its properties.
Call the object as if it were a function.
To learn more about how System objects work, see What Are System Objects?.
returns a
System object, trajectory = waypointTrajectorytrajectory, that generates a trajectory based on default
stationary waypoints.
specifies the trajectory = waypointTrajectory(Waypoints,TimeOfArrival)Waypoints that the generated trajectory passes through
and the TimeOfArrival at each waypoint.
sets each creation argument or property trajectory = waypointTrajectory(Waypoints,TimeOfArrival,Name,Value)Name to the specified
Value. Unspecified properties and creation arguments have default or
inferred values.
trajectory =
waypointTrajectory([10,10,0;20,20,0;20,20,10],[0,0.5,10]) creates a waypoint
trajectory System object, trajectory, that starts at waypoint
[10,10,0], and then passes through [20,20,0] after
0.5 seconds and [20,20,10] after 10 seconds.Creation arguments are properties which are set during creation of the System object and cannot be modified later. If you do not explicitly set a creation argument value, the property value is inferred.
If you specify any creation argument, then you must specify both the Waypoints and TimeOfArrival creation
arguments. You can specify Waypoints and
TimeOfArrival as value-only arguments or name-value pairs.
[
outputs a frame of trajectory data based on specified creation arguments and
properties.position,orientation,velocity,acceleration,angularVelocity] = trajectory()
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj, use
this syntax:
release(obj)
The waypointTrajectory System object defines a trajectory that smoothly passes
through waypoints. The trajectory connects the waypoints through an interpolation that assumes
the gravity direction expressed in the trajectory reference frame is constant. Generally, you
can use waypointTrajectory to model platform or vehicle trajectories within a
hundreds of kilometers distance span.
The planar path of the trajectory (the x-y plane
projection) consists of piecewise, clothoid curves. The curvature of the curve between two
consecutive waypoints varies linearly with the curve length between them. The tangent
direction of the path at each waypoint is chosen to minimize discontinuities in the curvature,
unless the course is specified explicitly via the Course property or
implicitly via the Velocities property. Once the path is established, the
object uses cubic Hermite interpolation to compute the location of the vehicle throughout the
path as a function of time and the planar distance travelled.
The normal component (z-component) of the trajectory is subsequently
chosen to satisfy a shape-preserving piecewise spline (PCHIP) unless the climb rate is
specified explicitly via the ClimbRate property or the third column of
the Velocities property. Choose the sign of the climb rate based on the
selected ReferenceFrame:
When an 'ENU' reference frame is selected, specifying a positive climb rate results in an increasing value of z.
When an 'NED' reference frame is selected, specifying a positive climb rate results in a decreasing value of z.
You can define the orientation of the vehicle through the path in two primary ways:
If the Orientation property is specified, then the object uses
a piecewise-cubic, quaternion spline to compute the orientation along the path as a
function of time.
If the Orientation property is not specified, then the yaw of
the vehicle is always aligned with the path. The roll and pitch are then governed by the
AutoBank and AutoPitch property values,
respectively.
AutoBank | AutoPitch | Description |
|---|---|---|
false | false | The vehicle is always level (zero pitch and roll). This is typically used for large marine vessels. |
false | true | The vehicle pitch is aligned with the path, and its roll is always zero. This is typically used for ground vehicles. |
true | false | The vehicle pitch and roll are chosen so that its local z-axis is aligned with the net acceleration (including gravity). This is typically used for rotary-wing craft. |
true | true | The vehicle roll is chosen so that its local transverse plane aligns with the net acceleration (including gravity). The vehicle pitch is aligned with the path. This is typically used for two-wheeled vehicles and fixed-wing aircraft. |