Main Content

driving.DubinsPathSegment

Dubins path segment

Description

A driving.DubinsPathSegment object represents a segment of a planned vehicle path that was connected using the Dubins connection method [1]. A Dubins path segment is composed of a sequence of three motions. Each motion is one of these types:

  • Straight

  • Left turn at the maximum steering angle of the vehicle

  • Right turn at the maximum steering angle of the vehicle

A vehicle path composed of Dubins path segments allows motion in the forward direction only.

The driving.DubinsPathSegment objects that represent a path are stored in the PathSegments property of a driving.Path object. These paths are planned by a pathPlannerRRT object whose ConnectionMethod property is set to 'Dubins'.

Properties

expand all

This property is read-only.

Initial pose of the vehicle at the start of the path segment, specified as an [x, y, Θ] vector. x and y are in world units, such as meters. Θ is in degrees.

This property is read-only.

Goal pose of the vehicle at the end of the path segment, specified as an [x, y, Θ] vector. x and y are in world units, such as meters. Θ is in degrees.

This property is read-only.

Minimum turning radius of the vehicle, in world units, specified as a positive real scalar. This value corresponds to the radius of the turning circle at the maximum steering angle of the vehicle.

This property is read-only.

Length of each motion in the path segment, in world units, specified as a three-element real-valued vector. Each motion length corresponds to a motion type specified in MotionTypes.

This property is read-only.

Type of each motion in the path segment, specified as a three-element string array. Valid values are shown in this table.

Motion TypeDescription
"S"Straight
"L"

Left turn at the maximum steering angle of the vehicle

"R"

Right turn at the maximum steering angle of the vehicle

Each motion type corresponds to a motion length specified in MotionLengths.

Example: ["R" "S" "R"]

This property is read-only.

Length of the path segment, in world units, specified as a positive real scalar.

Examples

collapse all

Plan a vehicle path through a parking lot by using the optimal rapidly exploring random tree (RRT*) algorithm. The planned path is composed of a sequence of Dubins path segments. Check that the path is valid, and then plot the transition poses along the path.

Load a costmap of a parking lot. Plot the costmap to see the parking lot and inflated areas for the vehicle to avoid.

data = load('parkingLotCostmapReducedInflation.mat');
costmap = data.parkingLotCostmapReducedInflation;
plot(costmap)

Figure contains an axes object. The axes object contains 2 objects of type image, patch. This object represents Inflated Areas.

Define start and goal poses for the vehicle as [x, y, Θ] vectors. World units for the (x,y) locations are in meters. World units for the Θ orientation angles are in degrees.

startPose = [4, 4, 90]; % [meters, meters, degrees]
goalPose = [53.3, 19, 90];

Use a pathPlannerRRT object to plan a path from the start pose to the goal pose. Set the ConnectionMethod property of the pathPlannerRRT object to 'Dubins'.

planner = pathPlannerRRT(costmap);
planner.ConnectionMethod = 'Dubins';
refPath = plan(planner,startPose,goalPose);

Check that the path is valid.

isPathValid = checkPathValidity(refPath,costmap)
isPathValid = logical
   1

Interpolate the transition poses along the path.

transitionPoses = interpolate(refPath);

Plot the planned path and the transition poses on the costmap.

hold on
plot(refPath,'DisplayName','Planned Path')
scatter(transitionPoses(:,1),transitionPoses(:,2),[],'filled', ...
   'DisplayName','Transition Poses')
hold off

Figure contains an axes object. The axes object contains 18 objects of type image, patch, scatter, line, polygon. These objects represent Inflated Areas, Planned Path, Transition Poses.

Notice that the path from the start pose to the goal pose does not require a reverse motion. Hence, the planned path is valid. In scenarios where a reverse motion is required to reach the goal pose, use Reeds-Shepp path segments as Dubins path segments do not allow reverse motion.

References

[1] Shkel, Andrei M., and Vladimir Lumelsky. "Classification of the Dubins Set." Robotics and Autonomous Systems. Vol. 34, Number 4, 2001, pp. 179–202.

Extended Capabilities

Introduced in R2018b