Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arfur-rs/frames
Contextual frames made simple.
https://github.com/arfur-rs/frames
Last synced: 14 days ago
JSON representation
Contextual frames made simple.
- Host: GitHub
- URL: https://github.com/arfur-rs/frames
- Owner: arfur-rs
- License: mit
- Created: 2022-06-23T19:58:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-03T15:25:45.000Z (over 2 years ago)
- Last Synced: 2024-03-15T04:09:43.542Z (10 months ago)
- Language: Rust
- Homepage: https://lib.rs/frames
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
![Frames](./docs/assets/header-long.png)
License
· Docs
You want to move your robot from point A to point B. That's all you ever want to do, really. The question is, how do you model the multiple frames that exist in your environment?
Say you have the following:
![Example figure](./docs/assets/fig-a.png)
In short — Frames solves for `(x, y, θ)` like so:
```rust
use frames::prelude::*;
use nalgebra::{Isometry2, Vector2};
use std::f32::consts::PI;fn main() -> Result<(), FrameError> {
let mut frames = Frames::new();let field = Frame::new("field");
let robot = Frame::new("robot");frames.add_frame(field, Isometry2::new(Vector2::new(0., 0.), 0.))?;
frames.add_frame(robot, Isometry2::new(Vector2::new(1., 1.), PI))?;let x = Point::new("x");
frames.add_point_in_context(
x,
Isometry2::new(Vector2::new(7., 5.), PI),
field,
)?;assert_eq!(
frames.get_point_in_context(x, robot)?,
Isometry2::new(Vector2::new(6., 4.), 0.)
);Ok(())
}
```## Features
* **Efficient** — optimized, no-nonsense calculations.
* **Scalable** — calculate in any dimensions.
* **Type-safe** — errors can be seen at compile-time.