Main Content

reedsSheppConnection

Reeds-Shepp path connection type

Description

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

  • Straight

  • Left turn at maximum steer

  • Right turn at maximum steer

  • No movement

A Reeds-Shepp path segment supports both forward and backward motion.

Use this connection object to define parameters for a vehicle motion model, including the minimum turning radius and options for path types. To generate a path segment between poses using this connection type, call the connect function.

Creation

Description

reedsConnObj = reedsSheppConnection creates an object using default property values.

example

reedsConnObj = reedsSheppConnection(Name,Value) specifies property values using name-value pairs. To set multiple properties, specify multiple name-value pairs.

example

Properties

expand all

Minimum turning radius for the vehicle, specified as a positive scalar in meters. The minimum turning radius is for the smallest circle the vehicle can make with maximum steer in a single direction.

Data Types: double

Path types to disable, specified as a vector of string scalars or cell array of character vectors.

Motion TypeDescription
"Sp","Sn"Straight (p = forward, n = reverse)
"Lp","Ln"

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

"Rp","Rn"

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

"N"No motion

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

To see all available path types, see the AllPathTypes property.

Example: ["LpSnLp","LnSnRpSn","LnSnRpSnLp"]

Data Types: cell

This property is read-only.

All possible path types, specified as a cell array of character vectors. This property lists all types. To disable certain types, specify types from this list in DisabledPathTypes.

For Reeds-Shepp connections, there are 44 possible combinations of motion types.

Data Types: cell

Cost multiple to travel forward, specified as a positive numeric scalar. Increase this property to penalize forward motion.

Data Types: double

Cost multiple to travel in reverse, specified as a positive numeric scalar. Increase this property to penalize reverse motion.

Data Types: double

Object Functions

connectConnect poses for given connection type

Examples

collapse all

Create a reedsSheppConnection object.

reedsConnObj = 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})

Figure contains an axes object. The axes object contains 13 objects of type line, scatter. These objects represent Forward Path, Reverse Path, Heading, Start Position, Goal Position.

Create a reedsSheppConnection object.

reedsConnObj = 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. Notice the direction of the turns.

show(pathSegObj{1})

Figure contains an axes object. The axes object contains 13 objects of type line, scatter. These objects represent Forward Path, Reverse Path, Heading, Start Position, Goal Position.

pathSegObj{1}.MotionTypes
ans = 1x5 cell
    {'L'}    {'R'}    {'L'}    {'N'}    {'N'}

pathSegObj{1}.MotionDirections
ans = 1×5

     1    -1     1     1     1

Disable this specific motion sequence in a new connection object. Reduce the MinTurningRadius if the robot is more maneuverable. Increase the reverse cost to reduce the likelihood of reverse directions being used. Connect the poses again to get a different path.

reedsConnObj = reedsSheppConnection('DisabledPathTypes',{'LpRnLp'});
reedsConnObj.MinTurningRadius = 0.5;
reedsConnObj.ReverseCost = 5;

[pathSegObj,pathCosts] = connect(reedsConnObj,startPose,goalPose);
pathSegObj{1}.MotionTypes
ans = 1x5 cell
    {'L'}    {'S'}    {'L'}    {'N'}    {'N'}

show(pathSegObj{1})
xlim([0 1.5])
ylim([0 1.5])

Figure contains an axes object. The axes object contains 10 objects of type line, scatter. These objects represent Forward Path, Heading, Start Position, Goal Position.

Extended Capabilities

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

Version History

Introduced in R2019b