waypointTrajectory
Waypoint trajectory generator
Description
ThewaypointTrajectory
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. SeeAlgorithmsfor 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, seeWhat Are System Objects?.
Creation
Syntax
Description
returns a System object,trajectory
= waypointTrajectorytrajectory
, that generates a trajectory based on default stationary waypoints.
specifies thetrajectory
= waypointTrajectory(Waypoints
,TimeOfArrival
)Waypoints
that the generated trajectory passes through and theTimeOfArrival
at each waypoint.
sets each creation argument or propertytrajectory
= waypointTrajectory(Waypoints
,TimeOfArrival
,Name,Value
)Name
to the specifiedValue
. Unspecified properties and creation arguments have default or inferred values.
Example: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
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 theWaypointsandTimeOfArrivalcreation arguments. You can specifyWaypoints
andTimeOfArrival
as value-only arguments or name-value pairs.
Properties
Usage
Description
[
outputs a frame of trajectory data based on specified creation arguments and properties.position
,orientation
,velocity
,acceleration
,angularVelocity
] = trajectory()
Output Arguments
Object Functions
To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object namedobj
, use this syntax:
release(obj)
Examples
Algorithms
ThewaypointTrajectory
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 usewaypointTrajectory
to model platform or vehicle trajectories within a hundreds of kilometers distance span.
The planar path of the trajectory (thex-yplane 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 theCourse
property or implicitly via theVelocities
财产。一旦建立了路径,对象uses cubic Hermite interpolation to compute the location of the vehicle throughout the path as a function of time and the planar distance traveled.
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 theClimbRate
property or the third column of theVelocities
财产。Choose the sign of the climb rate based on the selectedReferenceFrame
:
When an 'ENU' reference frame is selected, specifying a positive climb rate results in an increasing value ofz.
When an 'NED' reference frame is selected, specifying a positive climb rate results in a decreasing value ofz.
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 theAutoBank
andAutoPitch
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 localz-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.