Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openrr/rrt
RRT (Rapidly-exploring Random Tree) library in Rust
https://github.com/openrr/rrt
algorithm pathfinding pathplan robotics rrt rust search
Last synced: 4 days ago
JSON representation
RRT (Rapidly-exploring Random Tree) library in Rust
- Host: GitHub
- URL: https://github.com/openrr/rrt
- Owner: openrr
- License: apache-2.0
- Created: 2017-07-25T04:55:59.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-12-26T02:48:52.000Z (29 days ago)
- Last Synced: 2025-01-12T16:05:35.327Z (11 days ago)
- Topics: algorithm, pathfinding, pathplan, robotics, rrt, rust, search
- Language: Rust
- Homepage:
- Size: 49.8 KB
- Stars: 35
- Watchers: 5
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-list - rrt - exploring Random Tree) library in Rust. (Path Planning)
- awesome-rust-list - rrt - exploring Random Tree) library in Rust. (Path Planning)
README
# rrt
[![Build Status](https://img.shields.io/github/actions/workflow/status/openrr/rrt/ci.yml?branch=main&logo=github)](https://github.com/openrr/rrt/actions) [![crates.io](https://img.shields.io/crates/v/rrt.svg?logo=rust)](https://crates.io/crates/rrt) [![docs](https://docs.rs/rrt/badge.svg)](https://docs.rs/rrt) [![discord](https://dcbadge.vercel.app/api/server/8DAFFKc88B?style=flat)](https://discord.gg/8DAFFKc88B)
RRT (Rapidly-exploring Random Tree) library in Rust.
Only Dual RRT Connect is supported.
## Examples
There is [an example](https://github.com/openrr/rrt/blob/main/examples/collision_avoid.rs) to solve collision avoid problem.
```bash
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`.```rust
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);
```## `OpenRR` Community
[Here](https://discord.gg/8DAFFKc88B) is a discord server for `OpenRR` users and developers.