embedded-flight-core 0.1.1

Embedded flight core library
Documentation
#![cfg_attr(not(test), no_std)]

use nalgebra::{Quaternion, Vector3};

pub mod filter;

pub trait InertialSensor {
    fn attitude(&mut self) -> Quaternion<f32>;

    fn gyro(&mut self) -> Vector3<f32>;
}

/// Motor output containing the desired pitch, roll, and yaw control and feed forward in -1 ~ +1.
#[derive(Debug)]
pub struct MotorOutput<T> {
    pub control: Vector3<T>,
    pub feed_forward: Vector3<T>,
}

impl<T> MotorOutput<T> {
    pub fn new(control: Vector3<T>, feed_forward: Vector3<T>) -> Self {
        Self {
            control,
            feed_forward,
        }
    }
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        let result = 2 + 2;
        assert_eq!(result, 4);
    }
}