Main Content

mobileRobotPRM

Create probabilistic roadmap path planner

Description

The mobileRobotPRM object is 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 mobileRobotPRM 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 mobileRobotPRM properties, call update, show, or findpath to recreate the roadmap.

Creation

Description

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

planner = mobileRobotPRM(map) creates a roadmap with map set as the Map property, where map is a binaryOccupancyMap object.

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

Input Arguments

expand all

Map representation, specified as a binaryOccupancyMap 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 binaryOccupancyMap or occupancyMap (Navigation Toolbox) 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.

Object Functions

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

Extended Capabilities

Version History

Introduced in R2019b

expand all