M-File Help: DXform | View code for DXform

# DXform

Distance transform navigation class

A concrete subclass of the Navigation class that implements the distance transform navigation algorithm which computes minimum distance paths.

## Methods

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

## Properties

distancemap | The distance transform of the occupancy grid.
metric | The distance metric, can be 'euclidean' (default) or 'cityblock'

## Example

    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

## Notes

- Obstacles are represented by NaN in the distancemap.
- The value of each element in the distancemap is the shortest distance from the corresponding point in the map to the current goal.

## References

- Robotics, Vision & Control, Sec 5.2.1, Peter Corke, Springer, 2011.

## See also

Navigation, Dstar, PRM, distancexform

# DXform.DXform

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).

## Options

'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.

## See also

Navigation.Navigation

# DXform.char

Convert to string

DX.char() is a string representing the state of the object in human-readable form.

See also DXform.display, Navigation.char

# DXform.plan

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.

## Notes

- This may take many seconds.

# DXform.plot

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).

## See also

Navigation.plot

# DXform.plot3d

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.

## See also

Navigation.plot

© 1990-2014 Peter Corke.