frames

Crates.ioframes
lib.rsframes
version0.1.0
sourcesrc
created_at2022-06-23 20:08:33.740698
updated_at2022-07-01 15:51:59.755205
descriptionContextual frames made simple.
homepage
repositoryhttps://github.com/bobbbay/frames
max_upload_size
id612067
size6,705
Bob (bobbbay)

documentation

README

Frames

License · Docs

Crates.io docs.rs Codecov


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

In short — Frames solves for (x, y, θ) like so:

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.
Commit count: 19

cargo fmt