M-File Help: DXform | View code for DXform |
Distance transform navigation class
A concrete subclass of the Navigation class that implements the distance transform navigation algorithm which computes minimum distance paths.
plan | Compute the cost map given a goal and map |
path | Compute a path to the goal |
visualize | Display the obstacle map (deprecated) |
plot | Display the distance function and obstacle map |
plot3d | Display the distance function as a surface |
display | Print the parameters in human readable form |
char | Convert to string |
distancemap | The distance transform of the occupancy grid. |
metric | The distance metric, can be 'euclidean' (default) or 'cityblock' |
load map1 % load map goal = [50,30]; % goal point start = [20, 10]; % start point dx = DXform(map); % create navigation object dx.plan(goal) % create plan for specified goal dx.path(start) % animate path from this start location
Navigation, Dstar, PRM, distancexform
Distance transform constructor
dx = DXform(map, options) is a distance transform 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).
'goal', G | Specify the goal point (2x1) |
'metric', M | Specify the distance metric as 'euclidean' (default) or 'cityblock'. |
'inflate', K | Inflate all obstacles by K cells. |
Other options are supported by the Navigation superclass.
Convert to string
DX.char() is a string representing the state of the object in human-readable form.
See also DXform.display, Navigation.char
Plan path to goal
DX.plan() updates the internal distancemap where the value of each element is the minimum distance from the corresponding point to the goal. The goal is as specified to the constructor.
DX.plan(goal) as above but uses the specified goal.
DX.plan(goal, s) as above but displays the evolution of the distancemap, with one iteration displayed every s seconds.
Visualize navigation environment
DX.plot() displays the occupancy grid and the goal distance in a new figure. The goal distance is shown by intensity which increases with distance from the goal. Obstacles are overlaid and shown in red.
DX.plot(p) as above but also overlays a path given by the set of points p (Mx2).
3D costmap view
DX.plot3d() displays the distance function as a 3D surface with distance from goal as the vertical axis. Obstacles are "cut out" from the surface.
DX.plot3d(p) as above but also overlays a path given by the set of points p (Mx2).
DX.plot3d(p, ls) as above but plot the line with the linestyle ls.
© 1990-2012 Peter Corke.