Skip to main content

DriveFuture

Struct DriveFuture 

Source
pub struct DriveFuture<'a, M, L, A, T>
where M: Arcade, L: Feedback<State = f64, Signal = f64> + Unpin, A: Feedback<State = Angle, Signal = f64> + Unpin, T: TracksForwardTravel + TracksHeading + TracksVelocity,
{ /* private fields */ }
Expand description

Drives the robot forward or backwards for a distance at a given heading.

Implementations§

Source§

impl<M, L, A, T> DriveFuture<'_, M, L, A, T>
where M: Arcade, L: Feedback<State = f64, Signal = f64> + Unpin, A: Feedback<State = Angle, Signal = f64> + Unpin, T: TracksForwardTravel + TracksHeading + TracksVelocity,

Source

pub fn with_linear_controller(&mut self, controller: L) -> &mut Self

Modifies this motion’s linear feedback controller.

Source

pub fn with_angular_controller(&mut self, controller: A) -> &mut Self

Modifies this motion’s angular feedback controller.

Source

pub const fn with_timeout(&mut self, timeout: Duration) -> &mut Self

Modifies this motion’s timeout duration.

Source

pub const fn without_timeout(&mut self) -> &mut Self

Removes this motion’s timeout duration.

Source

pub const fn with_linear_tolerances( &mut self, tolerances: Tolerances, ) -> &mut Self

Modifies this motion’s linear tolerances.

Source

pub const fn with_linear_error_tolerance(&mut self, tolerance: f64) -> &mut Self

Modifies this motion’s linear error tolerance.

Source

pub const fn without_linear_error_tolerance(&mut self) -> &mut Self

Removes this motion’s linear error tolerance.

Source

pub const fn with_linear_velocity_tolerance( &mut self, tolerance: f64, ) -> &mut Self

Modifies this motion’s linear velocity tolerance.

Source

pub const fn without_linear_velocity_tolerance(&mut self) -> &mut Self

Removes this motion’s linear velocity tolerance.

Source

pub const fn with_linear_tolerance_duration( &mut self, duration: Duration, ) -> &mut Self

Modifies this motion’s linear tolerance duration.

Source

pub const fn without_linear_tolerance_duration(&mut self) -> &mut Self

Removes this motion’s linear tolerance duration.

Source

pub const fn without_tolerance_duration(&mut self) -> &mut Self

Removes this motion’s linear and angular tolerance durations.

Source

pub const fn with_angular_tolerances( &mut self, tolerances: Tolerances, ) -> &mut Self

Modifies this motion’s angular tolerances.

Source

pub const fn with_angular_error_tolerance( &mut self, tolerance: f64, ) -> &mut Self

Modifies this motion’s angular error tolerance.

Source

pub const fn without_angular_error_tolerance(&mut self) -> &mut Self

Removes this motion’s angular error tolerance.

Source

pub const fn with_angular_velocity_tolerance( &mut self, tolerance: f64, ) -> &mut Self

Modifies this motion’s angular velocity tolerance.

Source

pub const fn without_angular_velocity_tolerance(&mut self) -> &mut Self

Removes this motion’s angular velocity tolerance.

Source

pub const fn with_angular_tolerance_duration( &mut self, duration: Duration, ) -> &mut Self

Modifies this motion’s angular tolerance duration.

Source

pub const fn without_angular_tolerance_duration(&mut self) -> &mut Self

Removes this motion’s angular tolerance duration.

Source§

impl<M, A, T> DriveFuture<'_, M, Pid, A, T>
where M: Arcade, A: Feedback<State = Angle, Signal = f64> + Unpin, T: TracksForwardTravel + TracksHeading + TracksVelocity,

Source

pub const fn with_linear_gains( &mut self, kp: f64, ki: f64, kd: f64, ) -> &mut Self

Modifies this motion’s linear PID gains.

Source

pub const fn with_linear_kp(&mut self, kp: f64) -> &mut Self

Modifies this motion’s linear proportional gain (kp).

Source

pub const fn with_linear_ki(&mut self, ki: f64) -> &mut Self

Modifies this motion’s linear integral gain (ki).

Source

pub const fn with_linear_kd(&mut self, kd: f64) -> &mut Self

Modifies this motion’s linear derivative gain (kd).

Source

pub const fn with_linear_integration_range( &mut self, integration_range: f64, ) -> &mut Self

Modifies this motion’s linear integration range.

Source

pub const fn without_linear_integration_range(&mut self) -> &mut Self

Removes this motion’s linear integration range.

Source

pub const fn with_linear_output_limit(&mut self, limit: f64) -> &mut Self

Modifies this motion’s linear output limit.

Source

pub const fn without_linear_output_limit(&mut self) -> &mut Self

Removes this motion’s linear output limit.

Source§

impl<M, L, T> DriveFuture<'_, M, L, AngularPid, T>
where M: Arcade, L: Feedback<State = f64, Signal = f64> + Unpin, T: TracksForwardTravel + TracksHeading + TracksVelocity,

Source

pub const fn with_angular_gains( &mut self, kp: f64, ki: f64, kd: f64, ) -> &mut Self

Modifies this motion’s angular PID gains.

Source

pub const fn with_angular_kp(&mut self, kp: f64) -> &mut Self

Modifies this motion’s angular proportional gain (kp).

Source

pub const fn with_angular_ki(&mut self, ki: f64) -> &mut Self

Modifies this motion’s angular integral gain (ki).

Source

pub const fn with_angular_kd(&mut self, kd: f64) -> &mut Self

Modifies this motion’s angular derivative gain (kd).

Source

pub const fn with_angular_integration_range( &mut self, integration_range: Angle, ) -> &mut Self

Modifies this motion’s angular integration range.

Source

pub const fn with_angular_output_limit(&mut self, limit: f64) -> &mut Self

Modifies this motion’s angular output limit.

Source

pub const fn without_angular_integration_range(&mut self) -> &mut Self

Removes this motion’s angular integration range.

Source

pub const fn without_angular_output_limit(&mut self) -> &mut Self

Removes this motion’s angular output limit.

Trait Implementations§

Source§

impl<M, L, A, T> Future for DriveFuture<'_, M, L, A, T>
where M: Arcade, L: Feedback<State = f64, Signal = f64> + Unpin, A: Feedback<State = Angle, Signal = f64> + Unpin, T: TracksForwardTravel + TracksHeading + TracksVelocity,

Source§

type Output = ()

The type of value produced on completion.
Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations§

§

impl<'a, M, L, A, T> Freeze for DriveFuture<'a, M, L, A, T>
where L: Freeze, A: Freeze,

§

impl<'a, M, L, A, T> RefUnwindSafe for DriveFuture<'a, M, L, A, T>
where L: RefUnwindSafe, A: RefUnwindSafe, M: RefUnwindSafe, T: RefUnwindSafe,

§

impl<'a, M, L, A, T> Send for DriveFuture<'a, M, L, A, T>
where L: Send, A: Send, M: Send, T: Send,

§

impl<'a, M, L, A, T> Sync for DriveFuture<'a, M, L, A, T>
where L: Sync, A: Sync, M: Sync, T: Sync,

§

impl<'a, M, L, A, T> Unpin for DriveFuture<'a, M, L, A, T>

§

impl<'a, M, L, A, T> UnsafeUnpin for DriveFuture<'a, M, L, A, T>
where L: UnsafeUnpin, A: UnsafeUnpin,

§

impl<'a, M, L, A, T> !UnwindSafe for DriveFuture<'a, M, L, A, T>

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.

Source§

impl<T> FutureExt for T
where T: Future + ?Sized,

Source§

fn map<U, F>(self, f: F) -> Map<Self, F>
where F: FnOnce(Self::Output) -> U, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn map_into<U>(self) -> MapInto<Self, U>
where Self::Output: Into<U>, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
where F: FnOnce(Self::Output) -> Fut, Fut: Future, Self: Sized,

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more
Source§

fn left_future<B>(self) -> Either<Self, B>
where B: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the left-hand variant of that Either. Read more
Source§

fn right_future<A>(self) -> Either<A, Self>
where A: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the right-hand variant of that Either. Read more
Source§

fn into_stream(self) -> IntoStream<Self>
where Self: Sized,

Convert this future into a single element stream. Read more
Source§

fn flatten(self) -> Flatten<Self>
where Self::Output: Future, Self: Sized,

Flatten the execution of this future when the output of this future is itself another future. Read more
Source§

fn flatten_stream(self) -> FlattenStream<Self>
where Self::Output: Stream, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Fuse a future such that poll will never again be called once it has completed. This method can be used to turn any Future into a FusedFuture. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: FnOnce(&Self::Output), Self: Sized,

Do something with the output of a future before passing it on. Read more
Source§

fn unit_error(self) -> UnitError<Self>
where Self: Sized,

Source§

fn never_error(self) -> NeverError<Self>
where Self: Sized,

Source§

fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>
where Self: Unpin,

A convenience for calling Future::poll on Unpin future types.
Source§

fn now_or_never(self) -> Option<Self::Output>
where Self: Sized,

Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to Future::poll. Read more
§

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<F> IntoFuture for F
where F: Future,

§

type Output = <F as Future>::Output

The output that the future will produce on completion.
§

type IntoFuture = F

Which kind of future are we turning this into?
§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
§

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.