1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#![cfg_attr(not(test), no_std)]
use nalgebra::{Quaternion, Vector3};
pub mod filter;
pub mod scheduler;
pub trait InertialSensor {
fn attitude(&mut self) -> Quaternion<f32>;
fn gyro(&mut self) -> Vector3<f32>;
}
#[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);
}
}