https://github.com/openrr/trajectory
trajectory interpolation library for Rust and robotics
https://github.com/openrr/trajectory
cubic-splines interpolation robotics rust spline
Last synced: 6 months ago
JSON representation
trajectory interpolation library for Rust and robotics
- Host: GitHub
- URL: https://github.com/openrr/trajectory
- Owner: openrr
- License: apache-2.0
- Created: 2017-12-25T14:02:19.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-23T05:21:51.000Z (over 1 year ago)
- Last Synced: 2024-04-24T08:27:29.949Z (about 1 year ago)
- Topics: cubic-splines, interpolation, robotics, rust, spline
- Language: Rust
- Homepage:
- Size: 124 KB
- Stars: 25
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-list - trajectory
- awesome-rust-list - trajectory
README
# trajectory
[](https://github.com/openrr/trajectory/actions) [](https://crates.io/crates/trajectory) [](https://docs.rs/trajectory) [](https://discord.gg/8DAFFKc88B)
Trajectory interpolator for Rust.
## Code example
```rust
use trajectory::{CubicSpline, Trajectory};let times = vec![0.0_f64, 1.0, 3.0, 4.0];
let points = vec![
vec![0.0, -1.0],
vec![2.0, -3.0],
vec![3.0, 3.0],
vec![1.0, 5.0],
];
let ip = CubicSpline::new(times, points).unwrap();
for i in 0..400 {
let t = i as f64 * 0.01_f64;
let p = ip.position(t).unwrap();
let v = ip.velocity(t).unwrap();
let a = ip.acceleration(t).unwrap();
}
```## Run example
It requires `gnuplot`.
```bash
cargo run --example plot
```
## `OpenRR` Community
[Here](https://discord.gg/8DAFFKc88B) is a discord server for `OpenRR` users and developers.