Struct Basic

Source
pub struct Basic<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> {
    pub linear_controller: L,
    pub angular_controller: A,
    pub linear_tolerances: Tolerances,
    pub angular_tolerances: Tolerances,
    pub timeout: Option<Duration>,
}
Expand description

Feedback-driven driving and turning.

Fields§

§linear_controller: L

Linear (forward driving) feedback controller.

§angular_controller: A

Angular (turning) feedback controller.

§linear_tolerances: Tolerances

Linear settling conditions.

§angular_tolerances: Tolerances

Angular settling conditions.

§timeout: Option<Duration>

Maximum duration the motion can take before being cancelled.

Implementations§

Source§

impl<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> Basic<L, A>

Source

pub fn drive_distance_at_heading<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, target_distance: f64, target_heading: Angle, ) -> DriveDistanceAtHeadingFuture<'a, L, A, T>

Moves the robot forwards by a given distance (measured in wheel units) while turning to face a heading.

Negative target_distance values will move the robot backwards.

Source

pub fn drive_distance<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, distance: f64, ) -> DriveDistanceAtHeadingFuture<'a, L, A, T>

Moves the robot forwards by a given distance (measured in wheel units).

Negative distance values will move the robot backwards.

Source

pub fn turn_to_heading<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, heading: Angle, ) -> DriveDistanceAtHeadingFuture<'a, L, A, T>

Turns the robot in place to face a heading.

Source

pub fn turn_to_point<'a, T: TracksForwardTravel + TracksPosition + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, point: impl Into<Vec2<f64>>, ) -> TurnToPointFuture<'a, L, A, T>

Turns the robot in place to face a 2D point.

Trait Implementations§

Source§

impl<L: PartialEq + ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: PartialEq + ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> PartialEq for Basic<L, A>

Source§

fn eq(&self, other: &Basic<L, A>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> StructuralPartialEq for Basic<L, A>

Auto Trait Implementations§

§

impl<L, A> Freeze for Basic<L, A>
where L: Freeze, A: Freeze,

§

impl<L, A> RefUnwindSafe for Basic<L, A>

§

impl<L, A> Send for Basic<L, A>
where L: Send, A: Send,

§

impl<L, A> Sync for Basic<L, A>
where L: Sync, A: Sync,

§

impl<L, A> Unpin for Basic<L, A>

§

impl<L, A> UnwindSafe for Basic<L, A>
where L: UnwindSafe, A: 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.