24 lines
579 B
Rust
24 lines
579 B
Rust
use crate::core::{
|
|
motor,
|
|
positional,
|
|
units,
|
|
};
|
|
|
|
|
|
///The Config for the PID system used by the controller
|
|
pub struct PIDConfig {
|
|
///The Porportional value for the controller
|
|
pub kp: f32,
|
|
///The Integral value for the controller
|
|
pub ki: f32,
|
|
///The Derivative value for the controller
|
|
pub kd: f32,
|
|
///The Feedforward value for the controller
|
|
pub ff: f32,
|
|
|
|
}
|
|
|
|
///Controller trait for motors. Motors with this trait, automatically have a PID included.
|
|
pub trait Controller : motor::Driver + motor::Sensor {
|
|
const CONFIG: PIDConfig;
|
|
} |