From ff448bf1affbafa7f17ce842e997d3728724249b Mon Sep 17 00:00:00 2001 From: melfey Date: Sat, 13 Jun 2026 12:11:31 -0500 Subject: [PATCH] Added a retrieve method This will let you get the speed from the motor directly without the future communication system being needed --- src/core/logic/motor.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/logic/motor.rs b/src/core/logic/motor.rs index e39a507..9d1136c 100644 --- a/src/core/logic/motor.rs +++ b/src/core/logic/motor.rs @@ -40,6 +40,12 @@ impl Controller { .set_speed_and_direction(motor_command, self.current_direction); } + ///Retrieve the speed from the motor inside the controller. + /// This allows you to get a speed value from behind the move. + pub fn retrieve(&self) -> motor::Speed { + self.motor.get_speed() + } + ///Creates a new Controller with a motor (of type T), a max speed and a pid::Config /// This then allows for you to use the controller with the provided types pub fn new(motor: T, max_speed: Speed, config: pid::Config) -> Self {