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.PRM class

Package: robotics

Create probabilistic roadmap path planner

Description

PRM creates a roadmap path planner object for the environment map specified in the Map property. The object uses the map to generate a roadmap, which is a network graph of possible paths in the map based on free and occupied spaces. You can customize the number of nodes, NumNodes, and the connection distance, ConnectionDistance, to fit the complexity of the map and find an obstacle-free path from a start to an end location.

After the map is defined, the PRM path planner generates the specified number of nodes throughout the free spaces in the map. A connection between nodes is made when a line between two nodes contains no obstacles and is within the specified connection distance.

After defining a start and end location, to find an obstacle-free path using this network of connections, use the findpath method. If findpath does not find a connected path, it returns an empty array. By increasing the number of nodes or the connection distance, you can improve the likelihood of finding a connected path, but tuning these properties is necessary. To see the roadmap and the generated path , use the visualization options in show. If you change any of the PRM properties, call update, show, or findpath to recreate the roadmap.

Construction

planner = robotics.PRM creates an empty roadmap with default properties. Before you can use the roadmap, you must specify a robotics.BinaryOccupancyGrid object in the Map property.

planner = robotics.PRM(map) creates a roadmap with map set as the Map property, where map is an object of the robotics.BinaryOccupancyGrid class.

planner = robotics.PRM(map,numnodes) sets the maximum number of nodes, numnodes, to the NumNodes property.

Input Arguments

expand all

Map representation, specified as a robotics.BinaryOccupancyGrid object. This object represents the environment of the robot. The object is a matrix grid with binary values indicating obstacles as true (1) and free locations as false (0).

Maximum number of nodes in roadmap, specified as a scalar. By increasing this value, the complexity and computation time for the path planner increases.

Properties

expand all

Maximum distance between two connected nodes, specified as the comma-separated pair consisting of "ConnectionDistance" and a scalar in meters. This property controls whether nodes are connected based on their distance apart. Nodes are connected only if no obstacles are directly in the path. By decreasing this value, the number of connections is lowered, but the complexity and computation time decreases as well.

Map representation, specified as the comma-separated pair consisting of "Map" and a robotics.BinaryOccupancyGrid or robotics.OccupancyGrid object. This object represents the environment of the robot. The object is a matrix grid with values indicating the occupancy of locations in the map.

Number of nodes in the map, specified as the comma-separated pair consisting of "NumNodes" and a scalar. By increasing this value, the complexity and computation time for the path planner increases.

Methods

findpathFind path between start and goal points on roadmap
showShow map, roadmap, and path
updateCreate or update roadmap

Extended Capabilities

Introduced in R2015a