Main Content

connectingPoses

(Not recommended) Obtain connecting poses along vehicle path

connectingPoses is not recommended. Use interpolate instead. For more information, see Version History

Description

poses = connectingPoses(path) returns the connecting poses that are between the key poses of a vehicle path.

poses = connectingPoses(path,segID) returns the connecting poses that are along the path segment specified by segID.

poses = connectingPoses(___,'NumSamples',numSamples) specifies the number of connecting poses to compute between successive key poses, using either of the preceding syntaxes.

Input Arguments

collapse all

Planned vehicle path from which to obtain connecting poses, specified as a driving.Path object.

ID of the path segment from which to obtain connecting poses, specified as a positive integer. Each path segment has two successive key poses as its endpoints. segID must be less than the number of segments in the input path.

Number of connecting poses to sample from each segment, specified as an integer greater than 1.

Example: 'NumSamples',50

Output Arguments

collapse all

Connecting poses, returned as an m-by-3 matrix of [x, y, Θ] poses. Each row corresponds to a separate pose. x and y are specified in world coordinates and Θ is in degrees. poses includes all key poses.

Version History

Introduced in R2018a

collapse all

R2018b: connectingPoses function and driving.Path object properties KeyPoses and NumSegments are not recommended

The connectingPoses function and the KeyPoses and NumSegments properties of the driving.Path object are not recommended. Instead, use the interpolate function, which returns key poses, connecting poses, transition poses, and direction changes. The KeyPoses and NumSegments properties are no longer relevant. KeyPoses, NumSegments, and connectingPoses will be removed in a future release.

In R2018a, connectingPoses enabled you to obtain intermediate poses either along the entire path or along the path segments that are between key poses (as specified by KeyPoses). Using the interpolate function, you can now obtain intermediate poses at any specified point along the path. The interpolate function also provides transition poses at which changes in direction occur.

Update Code

Remove all instances of KeyPoses and NumSegments and replace all instances of connectingPoses with interpolate. The table shows typical usages of connectingPoses and how to update your code to use interpolate instead. Here, path is a driving.Path object returned by pathPlannerRRT.

Discouraged UsageRecommended Replacement
poses = connectingPoses(path);
poses = interpolate(path);
segID = 1;
posesSegment = connectingPoses(path,segID);

interpolate does not have a direct syntax for obtaining segment poses. However, you can sample poses of a segment using a specified step time. For example:

step = 0.1;
samples = 0 : step : path.PathSegments(1).Length;
segmentPoses = interpolate(path,samples);