Implementation of Rapidly exploring random trees. video https://youtu.be/i75tGsbwjXw
Links:
https://en.wikipedia.org/wiki/Rapidly-exploring_random_tree
http://msl.cs.uiuc.edu/~lavalle/papers/LavKuf01.pdf
Description:
-
main.cpp contains example to add obstacle and run algorithm.
-
class Cobs- defines obstacle Parameters required - startx, starty, width of obstacle, height of obstacle
-
class RRTMain - contains rrt implementation Parameters required - vector contaning all the of obstacles, width of cspace, height cspace
-
to run algorithm, fisrt need to call init() method using RRTMain object. Parameters - start location, goal location, step size and maxIteration
-
Call run() method using RRTMain object
-
Call save() methos using RRTMain object.
-
Path.txt, Obstacles.txt and Branches.txt will be generated,
Path.txt contains main route.
Obstacle.txt contains x,y position,width,height of obstacle
Branches.txt contains other explored branches
Environment:
Algorithm written in c++. Output is plotted with python3 and pygame. Set python environment with given requirements.txt file in plotter/ folder.
Plot Result:
- compile and run main.cpp.
- python plotter will ask for whether to plot "Branch.txt", provide 'y' or 'n' -- prefer 'n', as when iterations are large whole scrren will become cloudy with other branches. For small number of iterations it's okay.