updated positional traits to public, so its not upset about dead code.

This commit is contained in:
2026-05-23 18:43:27 -05:00
parent b7393971e2
commit a72efcfead
2 changed files with 22 additions and 4 deletions
+18
View File
@@ -11,7 +11,25 @@ pub struct MotorDriverShaftSpeed {
} }
impl MotorDriverShaftSpeed { impl MotorDriverShaftSpeed {
pub fn speed_as_rpm(&self) -> f32 {
match self.shaft_speed {
Some(mut speed) => {
match self.unit {
Unit::Radians => {speed /= core::f32::consts::PI * 2.0;}
_ => {}
}
match self.time_scale {
TimeScale::PerSecond => {speed *= 60.0;}
_ => {}
}
speed
}
None => {
0.0
}
}
}
} }
impl Display for MotorDriverShaftSpeed { impl Display for MotorDriverShaftSpeed {
+4 -4
View File
@@ -147,24 +147,24 @@ impl Display for XYZAccel {
} }
///Structs that impl this trait, mean they are positions. Determine what type of position by reading the unit. ///Structs that impl this trait, mean they are positions. Determine what type of position by reading the unit.
trait Position : XYZData { pub trait Position : XYZData {
} }
///Structs that impl this trait mean they are Velocities. Determine what type of velocity by reading the unit. ///Structs that impl this trait mean they are Velocities. Determine what type of velocity by reading the unit.
trait Velocity : XYZData{ pub trait Velocity : XYZData{
} }
///Structs that impl this trait mean they are Accelerations. Determine what type of Acceleration by reading the unit. ///Structs that impl this trait mean they are Accelerations. Determine what type of Acceleration by reading the unit.
trait Acceleration : XYZData{ pub trait Acceleration : XYZData{
} }
///This is the data backbone for the XYZ Position, Velocity, and Acceleration Data structs. ///This is the data backbone for the XYZ Position, Velocity, and Acceleration Data structs.
///They MUST implmenent this so it possible to easily and quickly get the data from the struct. ///They MUST implmenent this so it possible to easily and quickly get the data from the struct.
///Provides methods to check what type this is ///Provides methods to check what type this is
trait XYZData { pub trait XYZData {
fn x(&self) -> Option<f32>; fn x(&self) -> Option<f32>;
fn y(&self) -> Option<f32>; fn y(&self) -> Option<f32>;
fn z(&self) -> Option<f32>; fn z(&self) -> Option<f32>;