From d9f11b3f8e013225bbd5b14edcc11249647ac436 Mon Sep 17 00:00:00 2001 From: melfey Date: Sun, 24 May 2026 10:37:42 -0500 Subject: [PATCH] commented the plan for the for what the sensor trait methods will do. --- src/core/motor.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core/motor.rs b/src/core/motor.rs index 5ddfb06..d43b2c0 100644 --- a/src/core/motor.rs +++ b/src/core/motor.rs @@ -116,13 +116,22 @@ pub trait Driver { /// Some sensors may also provide current and voltage feedback, if implemented the communication system can sync them to the host you for. /// Can also be used for other custom logic. They are unused by RNavP, entirely optional. pub trait Sensor { - ///Gets a speed struct value from the motors sensor + ///Returns the speed struct value from the motors sensor /// This should be non-blocking, there should be some form of cached value ready to go as soon as the method is called - /// IF properly returned in the correct Enum Data field, all other systems will use the value propely + /// + /// IF properly returned in the correct Enum Data field, all other systems will use the value propely, being unit agnostic later. fn get_speed(&self) -> Speed; + ///Returns the current from the sensor, if it capable. + /// This should be non-blocking. Keep a cached value ready. fn get_current(&self) -> Option; + + ///Returns the current voltage from the sensro, if it is capable. + /// This should be non-blocking. Keep a cached value ready. fn get_voltage(&self) -> Option; + + ///Returns the current angle from the sensor if it is capable. + /// This should be non-blocking. Keep a cached value ready. fn get_angle(&self) -> Option; }