pub struct Voltages(pub f64, pub f64);Expand description
Left/Right Motor Voltages
Used as the standard output of a Command when working with the DifferentialDrivetrain
struct.
This struct is additionally a Command in itself, and can be used to run a drivetrain at a
fixed voltage.
Tuple Fields§
§0: f64§1: f64Implementations§
Source§impl Voltages
impl Voltages
Sourcepub fn normalized(&self, max: f64) -> Self
pub fn normalized(&self, max: f64) -> Self
Returns Voltages that are less than a provided max value while preserving
the ratio between the original left and right values.
If either motor is over a max_voltage, both values will be decresed by the amount
that is “oversaturated” to preserve the ratio between left and right power.
Trait Implementations§
impl Copy for Voltages
impl StructuralPartialEq for Voltages
Auto Trait Implementations§
impl Freeze for Voltages
impl RefUnwindSafe for Voltages
impl Send for Voltages
impl Sync for Voltages
impl Unpin for Voltages
impl UnwindSafe for Voltages
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more