M-File Help: Navigation | View code for Navigation |
Navigation superclass
An abstract superclass for implementing navigation classes.
plot | Display the occupancy grid |
visualize | Display the occupancy grid (deprecated) |
plan | Plan a path to goal |
path | Return/animate a path from start to goal |
display | Display the parameters in human readable form |
char | Convert to string |
rand | Uniformly distributed random number |
randn | Normally distributed random number |
randi | Uniformly distributed random integer |
occgrid | Occupancy grid representing the navigation environment |
goal | Goal coordinate |
seed0 | Random number state |
plan | Generate a plan for motion to goal |
next | Returns coordinate of next point along path |
goal_set | The goal has been changed by nav.goal = (a,b) |
navigate_init | Start of path planning. |
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.
'navhook', F | Specify a function to be called at every step of path |
'goal', G | Specify the goal point (2x1) |
'verbose' | Display debugging information |
'inflate', K | Inflate all obstacles by K cells. |
'private' | Use private random number stream. |
'reset' | Reset random number stream. |
'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. |
Convert to string
N.char() is a string representing the state of the navigation object in human-readable form.
Display status of navigation object
N.display() displays the state of the navigation object in human-readable form.
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.
Display 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.
Notify start of path
Invoked when the path() method is invoked. Typically overriden in a subclass to take particular action such as computing some path parameters. start is the initial position for this path, and nav.goal is the final position.
Follow path from start to goal
N.path(start) animates the robot moving from start (2x1) to the goal (which is a property of the object).
N.path() as above but first displays the occupancy grid, and prompts the user to click a start location. the object).
x = N.path(start) returns the path (2xM) from start to the goal (which is a property of the object).
The method performs the following steps:
Navigation.plot, Navigation.goal
Visualize navigation environment
N.plot() displays the occupancy grid in a new figure.
N.plot(p) as above but overlays the points along the path (Mx2) matrix.
'goal' | Superimpose the goal position if set |
'distance', D | Display a distance field D behind the obstacle map. D is a matrix of the same size as the occupancy grid. |
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.
Integer random number
i = N.randi(rm) return 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 return a matrix (MxM) of random integers.
i = N.randn(rm, L,m) as above but return a matrix (LxM) of random integers.
Normally distributed random number
R = N.randn() return a normally distributed random number from a private random number stream.
R = N.randn(m) as above but return a matrix (MxM) of random numbers.
R = N.randn(L,m) as above but return a matrix (LxM) of random numbers.
Update progress spinner
N.spinner() displays a simple ASCII progress spinner, a rotating bar.
Set verbosity
N.verbosity(v) set verbosity to v, where 0 is silent and greater values display more information.
© 1990-2012 Peter Corke.