Skip to main content

BaseController

Struct BaseController 

Source
pub struct BaseController<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> {
    pub fl: Tb6612<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm>,
    pub fr: Tb6612<W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm>,
    pub rl: Tb6612<W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm>,
    pub rr: Tb6612<W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>,
}

Fields§

§fl: Tb6612<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm>§fr: Tb6612<W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm>§rl: Tb6612<W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm>§rr: Tb6612<W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>

Implementations§

Source§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm: _embedded_hal_PwmPin<Duty = u16>, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm: _embedded_hal_PwmPin<Duty = u16>, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm: _embedded_hal_PwmPin<Duty = u16>, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm: _embedded_hal_PwmPin<Duty = u16>> BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>

Source

pub fn new( fl: Tb6612<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm>, fr: Tb6612<W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm>, rl: Tb6612<W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm>, rr: Tb6612<W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>, ) -> Self

Source

pub fn set_velocity(&mut self, vx: f32, vy: f32, omega: f32)

Set body-frame velocity. Inputs are normalized: -1.0..1.0 for each axis.

Source

pub fn brake(&mut self)

Brake all four wheels.

Auto Trait Implementations§

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> Freeze for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: Freeze, W2Pwm: Freeze, W3Pwm: Freeze, W4Pwm: Freeze,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> RefUnwindSafe for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: RefUnwindSafe, W2Pwm: RefUnwindSafe, W3Pwm: RefUnwindSafe, W4Pwm: RefUnwindSafe,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> Send for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: Send, W2Pwm: Send, W3Pwm: Send, W4Pwm: Send,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> Sync for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: Sync, W2Pwm: Sync, W3Pwm: Sync, W4Pwm: Sync,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> Unpin for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: Unpin, W2Pwm: Unpin, W3Pwm: Unpin, W4Pwm: Unpin,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> UnsafeUnpin for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: UnsafeUnpin, W2Pwm: UnsafeUnpin, W3Pwm: UnsafeUnpin, W4Pwm: UnsafeUnpin,

§

impl<const W1_IN1_P: char, const W1_IN1_N: u8, const W1_IN2_P: char, const W1_IN2_N: u8, W1Pwm, const W2_IN1_P: char, const W2_IN1_N: u8, const W2_IN2_P: char, const W2_IN2_N: u8, W2Pwm, const W3_IN1_P: char, const W3_IN1_N: u8, const W3_IN2_P: char, const W3_IN2_N: u8, W3Pwm, const W4_IN1_P: char, const W4_IN1_N: u8, const W4_IN2_P: char, const W4_IN2_N: u8, W4Pwm> UnwindSafe for BaseController<W1_IN1_P, W1_IN1_N, W1_IN2_P, W1_IN2_N, W1Pwm, W2_IN1_P, W2_IN1_N, W2_IN2_P, W2_IN2_N, W2Pwm, W3_IN1_P, W3_IN1_N, W3_IN2_P, W3_IN2_N, W3Pwm, W4_IN1_P, W4_IN1_N, W4_IN2_P, W4_IN2_N, W4Pwm>
where W1Pwm: UnwindSafe, W2Pwm: UnwindSafe, W3Pwm: UnwindSafe, W4Pwm: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.