Main Content

path

(To be removed) Create actor or vehicle path in driving scenario

path will be removed in a future release. Use trajectory instead.

Description

path(ac,waypoints) creates a path for an actor or vehicle, ac, using a set of waypoints. The actor follows the path at 30 m/s.

path(ac,waypoints,speed) also specifies the actor speed.

Input Arguments

collapse all

Actor belonging to a drivingScenario object, specified as an Actor or Vehicle object. To create these objects, use the actor and vehicle functions, respectively.

Path waypoints, specified as a real-valued N-by-2 or N-by-3 matrix, where N is the number of waypoints.

  • If you specify the waypoints as an N-by-2 matrix, then each matrix row represents the (x,y) coordinates of a waypoint. The z-coordinate of each waypoint is zero.

  • If you specify the waypoints as an N-by-3 matrix, then each matrix row represents the (x,y,z) coordinates of a waypoint.

All coordinates belong to the scenario coordinate system. Units are in meters.

Example: [1 0 0; 2 7 7]

Actor speed, specified as a positive real scalar or N-element vector of nonnegative values. N is the number of waypoints.

  • When speed is a scalar, the speed is constant throughout the actor motion.

  • When speed is a vector, the vector values specify the speed at each waypoint.

Speeds are interpolated between waypoints. speed can be zero at any waypoint but cannot be zero at two consecutive waypoints. Units are in meters per second.

Example: [10,8,10,11]

Algorithms

The path function creates a path for an actor to follow in a scenario. You specify the path using N two-dimensional or three-dimensional waypoints. Each of the N – 1 segments between waypoints defines a curve whose curvature varies linearly with distance along the segment. The function fits a piecewise clothoid curve to the (x,y) coordinates of the waypoints by matching the curvature on both sides of the waypoint. For a nonclosed curve, the curvature at the first and last waypoint is zero. If the first and last waypoints coincide, then the curvatures before and after the endpoints are matched. The z-coordinates of the path are interpolated using a shape-preserving piecewise cubic curve.

You can specify speed as a scalar or a vector. When speed is a scalar, the actor follows the path with constant speed. When speed is an N-element vector, speed is linearly interpolated between waypoints. Setting the speed to zero at two consecutive waypoints creates a stationary actor.

Version History

Introduced in R2017a

collapse all

See Also