Giter Site home page Giter Site logo

rrt's Introduction

rrt Build Status crates.io

RRT (Rapidly-exploring Random Tree) library in Rust

Using this crate

In your Cargo.tml, add below.

[dependencies]
rrt = "0.1.0"

Examples

There are an example to solve collision avoid problem.

cargo run --release --example collision_avoid

Below is the simplest example. It search the path from [-1.2, 0.0] to [1.2, 0.0] avoiding [-1, -1] - [1, 1] region. There are only one function dual_rrt_connect, which takes start, goal, is free function, random generation function, unit length of extend, max repeat num.

extern crate rand;
extern crate rrt;
fn main() {
  use rand::distributions::{IndependentSample, Range};
  let result = rrt::dual_rrt_connect(&[-1.2, 0.0],
                                     &[1.2, 0.0],
                                     |p: &[f64]| !(p[0].abs() < 1.0 && p[1].abs() < 1.0),
                                     || {
                                        let between = Range::new(-2.0, 2.0);
                                        let mut rng = rand::thread_rng();
                                        vec![between.ind_sample(&mut rng),
                                             between.ind_sample(&mut rng)]
                                     },
                                     0.2,
                                     1000)
              .unwrap();
  println!("{:?}", result);
  assert!(result.len() >= 4);
}

rrt's People

Contributors

otl avatar hdhoang avatar

Watchers

James Cloos 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.