Create probabilistic roadmap path planner
PRM creates a roadmap path planner object
for the environment map specified in the
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,
and the connection distance,
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
After defining a start and end location, to find an obstacle-free
path using this network of connections, use the
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
If you change any of the
PRM properties, call
findpath to recreate the roadmap.
an empty roadmap with default properties. Before you can use the roadmap,
you must specify a
planner = robotics.PRM
robotics.BinaryOccupancyGrid object in the
map— Map representation
Map representation, specified as a
This object represents the environment of the robot. The object is
a matrix grid with binary values indicating obstacles as
and free locations as
numnodes— Maximum number of nodes in roadmap
Maximum number of nodes in roadmap, specified as a scalar. By increasing this value, the complexity and computation time for the path planner increases.
ConnectionDistance— Maximum distance between two connected nodes
inf(default) | scalar in meters
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— Map representation
NumNodes— Number of nodes 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.
|findpath||Find path between start and goal points on roadmap|
|show||Show map, roadmap, and path|
|update||Create or update roadmap|
Usage notes and limitations:
map input must be specified on creation