View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Multiple Rapidly-exploring Random Tree (RRT)

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0
5.0 | 6 ratings Rate this file 43 Downloads (last 30 days) File Size: 14.7 KB File ID: #21443 Version: 1.4
image thumbnail

Multiple Rapidly-exploring Random Tree (RRT)

by

Gavin (view profile)

 

15 Sep 2008 (Updated )

Multiple RRT implementation for mobile robot path planning or C-space manipulator motion planning

| Watch this File

File Information
Description

% See Usage section in RrtPlanner.m file. This is a basic example of usage:

treesMax = 28; %How many multiple trees (must be at least 2, 1 for source and 1 for destination

seedsPerAxis = 3; %Number of seeds allowed on each axis (discretely placed seeds which idealy helps the RRT expansion)

wallCount = 5; %Number of mock walls to be placed in the environment

rrt = RrtPlanner(treesMax,seedsPerAxis,wallCount)
rrt.SetStart([0 -0.9 0]);
rrt.SetGoal([0 +0.9 0]);
rrt.Run()
plot3(rrt.smoothedPath(:,1),rrt.smoothedPath(:,2),rrt.smoothedPath(:,3),'k*');
delete(rrt);

obstacleFilename = 'obstacles.txt';
seedsPerAxis = 7;
treesMax = seedsPerAxis^3*3+2;
rrt = RrtPlanner(treesMax,seedsPerAxis,obstacleFilename);
rrt.drawingSkipsPerDrawing = 30;
rrt = RrtPlanner(treesMax,seedsPerAxis,obstacleFilename);
rrt.Run()
plot3(rrt.path(:,1),rrt.path(:,2),rrt.path(:,3),'k*');

% To generate an obstacle: create them by specifying rectangular planes as a set of 4 points around the bounds of a rectangle
A-------- B
| |
| |
| |
D---------C

% If this is flat on the z plane at 0.5 then the file would look something like this (with the x,y,z of A, B, C, D on separate lines)
0 0 0.5
1 0 0.5
1 1 0.5
0 1 0.5

A YouTube video of a simple case of this planner can be found here:
http://youtu.be/LodUn86QAfg

About RRTs:
RRTs first published in [1] are randomised planners especially adept at solving difficult,high-dimensional path planning problems. However, environments with low-connectivity due to the presence of obstacles can severely affect convergence. Multiple RRTs have been proposed as a means of addressing this issue, however, this approach can adversely affect computational efficiency.

This paper [2] published by the authors of this Matlab code is the implementation of multiple Rapidly-exploring Random Tree (RRT) algorithm work. This paper introduces a new and simple method which takes advantage of the benefits of multiple trees, whilst ensuring the computational burden of maintaining them is minimised. Results indicate that multiple RRTs are able to reduce the logarithmic complexity of the search, most notably in environments with high obstacle densities.

[1] LaValle, S. M., ‘Rapidly-Exploring Random Trees: A New Tool for Path Planning’, TR 98-11, Computer Science Department, Iowa State University, Oct. 1998.
[2] Matthew Clifton, Gavin Paul, Ngai Kwok, Dikai Liu, Da-Long Wang, "Evaluating Performance of Multiple RRTs", IEEE conference on Mechatronic and Embedded Systems and Application, 2008

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
02 Dec 2016 Reinis Cimurs

For those struggling with running the code, the download is just a function file. You should create a new file an call the function from there or just straight from the command window. The RrtPlanner.m file has the example in the comments on how to run the path planner.

Basically just create a new .m file in the same directory and copy (example) commands:

treesMax = 28; %How many multiple trees (must be at least 2, 1 for source and 1 for destination
seedsPerAxis = 3; %Number of seeds allowed on each axis (discretely placed seeds which idealy helps the RRT expansion)
wallCount = 5; %Number of mock walls to be placed in the environment
rrt = RrtPlanner(treesMax,seedsPerAxis,wallCount)
rrt.SetStart([0 -0.9 0]);
rrt.SetGoal([0 +0.9 0]);
rrt.Run()
plot3(rrt.smoothedPath(:,1),rrt.smoothedPath(:,2),rrt.smoothedPath(:,3),'k*');

This should run the program.

Comment only
12 Apr 2016 ziqidongzai

me too

Comment only
10 Oct 2015 SUSHMA MB

i am not able to run the code, as the code is only able to form the 3d obstacle. The path between the two points is not shown by this code. Can you please upload the updated code.

Comment only
13 Sep 2015 Tawfiq Rahman

Dear Gavin. Thanks for the code. However, I have been trying to run it without success. The program only gives me a 3D plot of the obstacles and the start and final points. I debugged the code and found the functions for RRT search does not come in the loop. Is there a way that you can help me run the code?

Comment only
12 May 2012 flora

flora (view profile)

 
23 Apr 2012 Felix

Felix (view profile)

 
30 Jan 2012 Patrik Eschle

Dear Gavin, thanks for providing this code. It would be easier to understand and implement if you would add a complete description of all arguments in the header of each function - the same way Matlab does.

There are also name collisions, 'connect' is just too generic. A good workaround is to use a prefix such as 'rrt_' to make function names more unique and to simplify renaming.

Comment only
10 Nov 2011 Nirav Chudasama

Thank You very much sir.

04 Nov 2011 zhaopeng QIU

It's very useful and helpful.

05 Aug 2011 zhao fei

The file could be helpful for me.Tkank you

18 Sep 2008 Samual Buraka

I've been searching for RRT matlab implementation for quite a while. Thanks for your effort

Updates
14 Mar 2013 1.3

This is now in Matlab OO (i.e. it is a class).
It is much improved speed. And also I fixed several bugs.

31 Oct 2013 1.4

There was a bug in the Connect method that was sometimes creating incorrect connections. Thanks to David for the bug fix.

Contact us