M-File Help: Bug2 | View code for Bug2 |
Bug navigation class
A concrete subclass of the abstract Navigation class that implements the bug2 navigation algorithm. This is a simple automaton that performs local planning, that is, it can only sense the immediate presence of an obstacle.
Bug2 | Constructor |
query | Find a path from start to goal |
plot | Display the obstacle map |
display | Display state/parameters in human readable form |
char | Convert to string |
load map1 % load the map bug = Bug2(map); % create navigation object start = [20,10]; goal = [50,35]; bug.query(start, goal); % animate path
Navigation, DXform, Dstar, PRM
Construct a Bug2 navigation object
b = Bug2(map, options) is a bug2 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 (1x2) |
'inflate', K | Inflate all obstacles by K cells. |
Find a path
B.query(start, goal, options) is the path (Nx2) from start (1x2) to goal (1x2). Row are the coordinates of successive points along the path. If either start or goal is [] the grid map is displayed and the user is prompted to select a point by clicking on the plot.
'animate' | show a simulation of the robot moving along the path |
'movie', M | create a movie |
'current' | show the current position position as a black circle |
© 1990-2014 Peter Corke.