6 releases (breaking)

0.5.0 Mar 3, 2021
0.4.0 May 23, 2018
0.3.0 Oct 21, 2017
0.2.0 Oct 9, 2017
0.1.1 Jul 25, 2017

#134 in Algorithms

Download history 449/week @ 2021-04-11 501/week @ 2021-04-18 282/week @ 2021-04-25 301/week @ 2021-05-02 591/week @ 2021-05-09 667/week @ 2021-05-16 520/week @ 2021-05-23 1011/week @ 2021-05-30 711/week @ 2021-06-06 515/week @ 2021-06-13 258/week @ 2021-06-20 359/week @ 2021-06-27 443/week @ 2021-07-04 564/week @ 2021-07-11 261/week @ 2021-07-18 463/week @ 2021-07-25

1,624 downloads per month
Used in 10 crates (2 directly)

Apache-2.0

22KB
238 lines

rrt

Build Status crates.io docs

RRT (Rapidly-exploring Random Tree) library in Rust

Using this crate

In your Cargo.tml, add below.

[dependencies]
rrt = "0.5"

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.

use rand::distributions::{Distribution, Uniform};
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 = Uniform::new(-2.0, 2.0);
        let mut rng = rand::thread_rng();
        vec![between.sample(&mut rng), between.sample(&mut rng)]
    },
    0.2,
    1000,
)
.unwrap();
println!("{:?}", result);
assert!(result.len() >= 4);

Dependencies

~570KB