M-File Help: PRM | View code for PRM |
Probabilistic RoadMap navigation class
A concrete subclass of the Navigation class that implements the probabilistic roadmap navigation algorithm. This performs goal independent planning of roadmaps, and at the query stage finds paths between specific start and goal points.
plan | Compute the roadmap |
path | Compute a path to the goal |
visualize | Display the obstacle map (deprecated) |
plot | Display the obstacle map |
display | Display the parameters in human readable form |
char | Convert to string |
load map1 % load map goal = [50,30]; % goal point start = [20, 10]; % start point prm = PRM(map); % create navigation object prm.plan() % create roadmaps prm.path(start, goal) % animate path from this start location
Navigation, DXform, Dstar, PGraph
Create a PRM navigation object
p = PRM(map, options) is a probabilistic roadmap navigation object, and map is an occupancy grid, a representation of a planar world as a matrix whose elements are 0 (free space) or 1 (occupied).
'npoints', N | Number of sample points (default 100) |
'distthresh', D | Distance threshold, edges only connect vertices closer than D (default 0.3 max(size(occgrid))) |
Other options are supported by the Navigation superclass.
Convert to string
P.char() is a string representing the state of the PRM object in human-readable form.
Find a path between two points
P.path(start, goal) finds and displays a path from start to goal which is overlaid on the occupancy grid.
x = P.path(start) returns the path (2xM) from start to goal.
Create a probabilistic roadmap
P.plan() creates the probabilistic roadmap by randomly sampling the free space in the map and building a graph with edges connecting close points. The resulting graph is kept within the object.
Visualize navigation environment
P.plot() displays the occupancy grid with an optional distance field.
'goal' | Superimpose the goal position if set |
'nooverlay' | Don't overlay the PRM graph |
© 1990-2012 Peter Corke.