Giter VIP home page Giter VIP logo

rrt_star's Introduction

RRT/RRT* for a simple car-like vehicle

Table of Contents
  1. Overview
  2. Dependencies
  3. Usage
  4. Acknowledgments

Overview

This is the code for my Software Carpentry final project. It builds either RRTs or RRT*s with drivable paths between nodes. An initial implementation generated feasible sub-trajectories using the differential flatness property of a simple car-like model, but since sampling in state space (x, y, yaw) proved to be computationally expensive, feasible trajectories are instead computed using a maximum heading difference between nodes with a non-zero minimum distance between nodes. This allows the nodes to be sampled in (x, y) space, which is substantially cheaper computationally. While this speed increase is substantial, the non-zero minimum distance between nodes can create dead zones, which can thereby sometimes prevent the algorithm from finding a solution to the goal.

Notably, this implementation supports arbitrarily-shaped obstacles through the use of Sympy Polygon objects!

Dependencies

  • numpy - conda install numpy
  • numba - conda install numba
  • matplotlib - conda install matplotlib
  • sympy - conda install sympy
  • tqdm - conda install -c conda-forge tqdm

Usage

To use this implementation in a main file that is executed:

  1. create a list of Obstacle objects (either circular or polygonal)
  2. specify an initial pose (x, y, yaw)
  3. specify a final pose
  4. create a tree object (either RRT or RRT*) using items 1-3
  5. call tree.build() to construct the tree
  6. call tree.visualize() to view the tree

An example usage is given in run.py. Since the algorithm is stochastic in nature, the output will change every time, but an example solution from the given run.py file is shown below. The solution is highlighted in magenta, with the start configuration at the bottom left and the goal configuration at the other end of the highlighted path.

example

Note: in the current implementation, an RRT will stop building the tree as soon as a path to the goal is found, whereas an RRT* will attempt to add a fixed number of nodes (specified by the N_SAMPLES parameter in params.py). This is because a major advantage of RRT* is that it will rewire nodes if a cheaper path becomes available, so the path to the goal can change accordingly.

Acknowledgements

rrt_star's People

Contributors

scpowers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.