Skip to content

Latest commit

 

History

History
83 lines (52 loc) · 2.66 KB

README.md

File metadata and controls

83 lines (52 loc) · 2.66 KB

RER_Tree - Rapidly Exploring Random Tree

This is an old project showing how a simple rapidly exploring random tree (RRT) can work. This was mainly used to see how a RRT works and to learn a bit of C++.

Rapidly Exploring Random Tree Demo

Rapidly Exploring Random Tree Large Demo

A rapidly exploring random tree is a search algorithm which we can employ in an n-dimensional space (not just 2d or 3d). We explore the space by picking random points / configurations and try to connect them to the tree. The tree grows this way until the end point is found. We can then traverse the tree from the root to the end point. I came first upon this topic when reading this blog post. by Casey Muratori for the witness.

Getting Started

Prerequisites

You need the sdl2 graphics library and cmake to build it.

On an arch based OS you can get the sdl2 library with:

sudo pacman -Sy sdl2.

On ubuntu it would probably be the library libsdl2 or libsdl2-dev.

sudo apt-get install libsdl2

sudo apt-get install libsdl2-dev

Installing

  1. clone or download the repo

git clone [email protected]:Laeri/rer_tree.git

  1. enter the folder and build it with cmake and make

cmake .

make

  1. run the binary in the bin folder

bin/rer_tree

Usage

  1. First left mouse click sets the starting point of the tree.
  2. Second click sets the endpoint.
  3. Then hold ctrl down and draw some obstacles with the mouse.
  4. Start the expansion by clicking s.
  5. Reset with r

Keybindings

s - starts or stops the tree expansion

d - set unset rect drawing (main purpose was to create images from the tree without having the rectangles there).

f - toggle fill rectangles or draw outlines

r - reset everything

left mouse - click twice for setting start and end point while the tree is expanding you can manually "help" it a bit if you want to which creates new tree points.

ctrl - while pressing the control key you can start drawing new rectangles. These rectangles represent obstacles

Escape or q - quit

You can freeze the expansion with s and raw some new obstacles if the tree makes too much progress or help it along by clicking with the mouse which instantly adds new points to the tree.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.