From 35d30bd213fecb8d4e86bd8c7b2634b0e6d48e0a Mon Sep 17 00:00:00 2001 From: melfey Date: Sun, 24 May 2026 12:11:37 -0500 Subject: [PATCH] Motor logic area has been started. --- src/core/logic/impls.rs | 0 src/core/logic/mod.rs | 4 +--- src/core/logic/motor.rs | 24 ++++++++++++++++++++++++ src/core/logic/structs.rs | 0 src/core/logic/traits.rs | 0 5 files changed, 25 insertions(+), 3 deletions(-) delete mode 100644 src/core/logic/impls.rs create mode 100644 src/core/logic/motor.rs delete mode 100644 src/core/logic/structs.rs delete mode 100644 src/core/logic/traits.rs diff --git a/src/core/logic/impls.rs b/src/core/logic/impls.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/core/logic/mod.rs b/src/core/logic/mod.rs index 8fc576d..e454905 100644 --- a/src/core/logic/mod.rs +++ b/src/core/logic/mod.rs @@ -1,4 +1,2 @@ -pub mod structs; pub mod kinematics; -pub mod impls; -pub mod traits; \ No newline at end of file +pub mod motor; \ No newline at end of file diff --git a/src/core/logic/motor.rs b/src/core/logic/motor.rs new file mode 100644 index 0000000..4583698 --- /dev/null +++ b/src/core/logic/motor.rs @@ -0,0 +1,24 @@ +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; +} \ No newline at end of file diff --git a/src/core/logic/structs.rs b/src/core/logic/structs.rs deleted file mode 100644 index e69de29..0000000 diff --git a/src/core/logic/traits.rs b/src/core/logic/traits.rs deleted file mode 100644 index e69de29..0000000