This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

robotics.ReedsSheppPathSegment

Reeds-Shepp path segment connecting two poses

Description

The ReedSheppPathSegment object holds information for a Reeds-Shepp path segment to connect between poses. A Reeds-Shepp path segment connects two poses as a sequence of five motion types. The motion options are:

  • Straight

  • Left turn at maximum steer

  • Right turn at maximum steer

  • No movement

Creation

To generate a ReedSheppPathSegment object, use the connect function with a robotics.ReedsSheppConnection object:

reedsPathSegObj = connect(connectionObj,start,goal) connects the start and goal poses using the specified connection type object.

To specifically define a path segment:

reedsPathSegObj = robotics.ReedsSheppPathSegment(connectionObj,start,goal,motionLengths,motionTypes) specifies the Reeds-Shepp connection type, the start and goal poses, and the corresponding motion lengths and types. These values are set to the corresponding properties in the object.

Properties

expand all

This property is read-only.

Minimum turning radius of the robot, specified as a positive scalar in meters. This value corresponds to the radius of the turning circle at the maximum steering angle of the robot.

Data Types: double

This property is read-only.

Initial pose of the robot at the start of the path segment, specified as an [x, y, Θ] vector. x and y are in meters. Θ is in radians.

Data Types: double

This property is read-only.

Goal pose of the robot at the end of the path segment, specified as an [x, y, Θ] vector. x and y are in meters. Θ is in radians.

Data Types: double

This property is read-only.

Length of each motion in the path segment, specified as a five-element numeric vector in meters. Each motion length corresponds to a motion type specified in MotionTypes.

Data Types: double

This property is read-only.

Type of each motion in the path segment, specified as a five-element string cell array. Valid values are:

Motion TypeDescription
"S"Straight (forward, p or reverse, n)
"L"

Left turn at the maximum steering angle of the vehicle (forward, p or reverse, n)

"R"

Right turn at the maximum steering angle of the vehicle (forward, p or reverse, n)

"N"No motion

If a path segment has fewer than five motion types, the remaining elements are "N" (no motion).

Example: {"L","S","R","L","R"}

Data Types: cell

This property is read-only.

Direction of each motion in the path segment, specified as a five-element vector of 1s (forward motion) and –1s (reverse motion). Each motion direction corresponds to a motion length specified in MotionLengths and a motion type specified in MotionTypes.

When no motion occurs, that is, when a MotionTypes value is "N", then the corresponding MotionDirections element is 1.

Example: [-1 1 -1 1 1]

Data Types: double

This property is read-only.

Length of the path segment, specified as a positive scalar in meters. This length is just a sum of the elements in MotionLengths.

Data Types: double

Object Functions

interpolateInterpolate poses along path segment
showVisualize path segment

Examples

collapse all

Create a ReedsSheppConnection object.

reedsConnObj = robotics.ReedsSheppConnection;

Define start and goal poses as [x y theta] vectors.

startPose = [0 0 0];
goalPose = [1 1 pi];

Calculate a valid path segment to connect the poses.

[pathSegObj,pathCosts] = connect(reedsConnObj,startPose,goalPose);

Show the generated path.

show(pathSegObj{1})

References

[1] Reeds, J. A., and L. A. Shepp. "Optimal Paths for a Car That Goes Both Forwards and Backwards." Pacific Journal of Mathematics. Vol. 145, Number 2, 1990, pp. 367–393.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2018b