M-File Help: RRT | View code for RRT |
Class for rapidly-exploring random tree navigation
A concrete subclass of the Navigation class that implements the rapidly exploring random tree (RRT) algorithm. This is a kinodynamic planner that takes into account the motion constraints of the vehicle.
plan | Compute the tree |
path | Compute a path |
plot | Display the tree |
display | Display the parameters in human readable form |
char | Convert to string |
goal = [0,0,0]; start = [0,2,0]; veh = Vehicle([], 'stlim', 1.2); rrt = RRT([], veh, 'goal', goal, 'range', 5); rrt.plan() % create navigation tree rrt.path(start, goal) % animate path from this start location
Robotics, Vision & Control compatability mode:
goal = [0,0,0]; start = [0,2,0]; rrt = RRT(); % create navigation object rrt.plan() % create navigation tree rrt.path(start, goal) % animate path from this start location
Navigation, PRM, DXform, Dstar, PGraph
Create a RRT navigation object
R = RRT.RRT(map, veh, options) is a rapidly exploring tree navigation object for a region with obstacles defined by the map object map.
R = RRT.RRT() as above but internally creates a Vehicle class object and does not support any map or options. For compatibility with RVC book.
'npoints', N | Number of nodes in the tree |
'time', T | Period to simulate dynamic model toward random point |
'range', R | Specify rectangular bounds |
'goal', P | Goal position (1x2) or pose (1x3) in workspace |
'speed', S | Speed of vehicle [m/s] (default 1) |
'steermax', S | Maximum steer angle of vehicle [rad] (default 1.2) |
Convert to string
R.char() is a string representing the state of the RRT object in human-readable form.
invoke the superclass char() method
Find a path between two points
x = R.path(start, goal) finds a path (Nx3) from state start (1x3) to the goal (1x3).
P.path(start, goal) as above but plots the path in 3D. The nodes are shown as circles and the line segments are blue for forward motion and red for backward motion.
Create a rapidly exploring tree
R.plan(options) creates the tree roadmap by driving the vehicle model toward random goal points. The resulting graph is kept within the object.
'goal', P | Goal pose (1x3) |
'noprogress' | Don't show the progress bar |
'samples' | Show samples |
Visualize navigation environment
R.plot() displays the navigation tree in 3D.
© 1990-2012 Peter Corke.