Skip to main content

Basic

Struct Basic 

Source
pub struct Basic<L, A>
where L: Feedback<State = f64, Signal = f64> + Unpin + Clone, A: Feedback<State = Angle, Signal = 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, A> Basic<L, A>
where L: Feedback<State = f64, Signal = f64> + Unpin + Clone, A: Feedback<State = Angle, Signal = f64> + Unpin + Clone,

Source

pub fn drive_distance_at_heading<'a, M: Arcade, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<M, T>, target_distance: f64, target_heading: Angle, ) -> DriveFuture<'a, M, 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, M: Arcade, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<M, T>, distance: f64, ) -> DriveFuture<'a, M, 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, M: Arcade, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<M, T>, heading: Angle, ) -> DriveFuture<'a, M, L, A, T>

Turns the robot in place to face a heading.

Source

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

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

Trait Implementations§

Source§

impl<L, A> PartialEq for Basic<L, A>
where L: Feedback<State = f64, Signal = f64> + Unpin + Clone + PartialEq, A: Feedback<State = Angle, Signal = f64> + Unpin + Clone + PartialEq,

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§

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, A> StructuralPartialEq for Basic<L, A>
where L: Feedback<State = f64, Signal = f64> + Unpin + Clone, A: Feedback<State = Angle, Signal = f64> + Unpin + Clone,

Auto Trait Implementations§

§

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

§

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

§

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> UnsafeUnpin for Basic<L, A>
where L: UnsafeUnpin, A: UnsafeUnpin,

§

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

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.