M-File Help: Navigation View code for Navigation

Navigation

Navigation superclass

An abstract superclass for implementing planar grid-based navigation classes.

Methods

Navigation Superclass constructor
plan Find a path to goal
query Return/animate a path from start to goal
plot Display the occupancy grid
display Display the parameters in human readable form
char Convert to string
isoccupied Test if cell is occupied
rand Uniformly distributed random number
randn Normally distributed random number
randi Uniformly distributed random integer
progress_init Create a progress bar
progress Update progress bar
progress_delete Remove progress bar

Properties (read only)

occgrid Occupancy grid representing the navigation environment
goal Goal coordinate
start Start coordinate
seed0 Random number state

Methods that must be provided in subclass

plan Generate a plan for motion to goal
next Returns coordinate of next point along path

Methods that may be overriden in a subclass

goal_set The goal has been changed by nav.goal = (a,b)
navigate_init Start of path planning.

Notes

See also

Bug2, Dstar, Dxform, PRM, Lattice, RRT


Navigation.Navigation

Create a Navigation object

n = Navigation(occgrid, options) is a Navigation object that holds an occupancy grid occgrid. A number of options can be be passed.

Options

'goal', G Specify the goal point (2x1)
'inflate', K Inflate all obstacles by K cells.
'private' Use private random number stream.
'reset' Reset random number stream.
'verbose' Display debugging information
'seed', S Set the initial state of the random number stream. S must be a proper random number generator state such as saved in the seed0 property of an earlier run.

Notes

See also

randstream


Navigation.char

Convert to string

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


Navigation.display

Display status of navigation object

N.display() displays the state of the navigation object in human-readable form.

Notes

See also

Navigation.char


Navigation.goal_change

Notify change of goal

Invoked when the goal property of the object is changed. Typically this is overriden in a subclass to take particular action such as invalidating a costmap.


Navigation.isoccupied

Test if grid cell is occupied

N.isoccupied(pos) is true if there is a valid grid map and the coordinate pos (1x2) is occupied. P=[X,Y] rather than MATLAB row-column coordinates.

N.isoccupied(x,y) as above but the coordinates given separately.


Navigation.message

Print debug message

N.message(s) displays the string s if the verbose property is true.

N.message(fmt, args) as above but accepts printf() like semantics.


Navigation.navigate_init

Notify start of path

N.navigate_init(start) is called when the query() method is invoked. Typically overriden in a subclass to take particular action such as computing some path parameters. start (2x1) is the initial position for this path, and nav.goal (2x1) is the final position.

See also

Navigate.query


Navigation.plot

Visualize navigation environment

N.plot(options) displays the occupancy grid in a new figure.

N.plot(p, options) as above but overlays the points along the path (2xM) matrix.

Options

'distance', D Display a distance field D behind the obstacle map. D is a matrix of the same size as the occupancy grid.
'colormap', @f Specify a colormap for the distance field as a function handle, eg. @hsv
'beta', B Brighten the distance field by factor B.
'inflated' Show the inflated occupancy grid rather than original

Notes

See also

Navigation.plot_fg, Navigation.plot_bg


Navigation.plot_bg

Visualization background

N.plot_bg(options) displays the occupancy grid with occupied cells shown as red and an optional distance field.

N.plot_bg(p,options) as above but overlays the points along the path (2xM) matrix.

Options

'distance', D Display a distance field D behind the obstacle map. D is a matrix of the same size as the occupancy grid.
'colormap', @f Specify a colormap for the distance field as a function handle, eg. @hsv
'beta', B Brighten the distance field by factor B.
'inflated' Show the inflated occupancy grid rather than original
'pathmarker', M Options to draw a path point
'startmarker', M Options to draw the start marker
'goalmarker', M Options to draw the goal marker

Notes

See also

Navigation.plot, Navigation.plot_fg, brighten


Navigation.plot_fg

Visualization foreground

N.plot_fg(options) displays the start and goal locations if specified. By default the goal is a pentagram and start is a circle.

N.plot_fg(p, options) as above but overlays the points along the path (2xM) matrix.

Options

'pathmarker', M Options to draw a path point
'startmarker', M Options to draw the start marker
'goalmarker', M Options to draw the goal marker

Notes

See also

Navigation.plot_bg


Navigation.query

Find a path from start to goal using plan

N.query(start, options) animates the robot moving from start (2x1) to the goal (which is a property of the object) using a previously computed plan.

x = N.query(start, options) returns the path (Mx2) from start to the goal (which is a property of the object).

The method performs the following steps:

Options

'animate' Show the computed path as a series of green dots.

Notes

See also

Navigation.navigate_init, Navigation.plot, Navigation.goal


Navigation.rand

Uniformly distributed random number

R = N.rand() return a uniformly distributed random number from a private random number stream.

R = N.rand(m) as above but return a matrix (MxM) of random numbers.

R = N.rand(L,m) as above but return a matrix (LxM) of random numbers.

Notes

See also

Navigation.randi, Navigation.randn, rand, RandStream


Navigation.randi

Integer random number

i = N.randi(rm) returns a uniformly distributed random integer in the range 1 to rm from a private random number stream.

i = N.randi(rm, m) as above but returns a matrix (MxM) of random integers.

i = N.randn(rm, L,m) as above but returns a matrix (LxM) of random integers.

Notes

See also

Navigation.rand, Navigation.randn, randi, RandStream


Navigation.randn

Normally distributed random number

R = N.randn() returns a normally distributed random number from a private random number stream.

R = N.randn(m) as above but returns a matrix (MxM) of random numbers.

R = N.randn(L,m) as above but returns a matrix (LxM) of random numbers.

Notes

See also

Navigation.rand, Navigation.randi, randn, RandStream


Navigation.spinner

Update progress spinner

N.spinner() displays a simple ASCII progress spinner, a rotating bar.


Navigation.verbosity

Set verbosity

N.verbosity(v) set verbosity to v, where 0 is silent and greater values display more information.


 

© 1990-2014 Peter Corke.