Skip to Content
VectorLib

SwingToHeading

vectorlib::SwingToHeading — fields, methods, parameters and return types.


pub struct SwingToHeading<'a>

Builder returned by Chassis::swing_to_heading.

View source

Methods

Prop

Type

direction

pub fn direction(self, direction: super::AngularDirection) -> Self

The direction to turn in. Auto by default.

Parameters

Prop

Type

Returns

Self

View source

max_speed

pub fn max_speed(self, max_speed: f32) -> Self

Maximum speed, 0-127. 127 by default.

Parameters

Prop

Type

Returns

Self

View source

min_speed

pub fn min_speed(self, min_speed: f32) -> Self

Minimum speed, 0-127. Non-zero switches to motion-chaining exit conditions.

Parameters

Prop

Type

Returns

Self

View source

early_exit_range

pub fn early_exit_range(self, early_exit_range: f32) -> Self

Exit when within this many degrees. Only used when min_speed is non-zero.

Parameters

Prop

Type

Returns

Self

View source

early_lambda_range

pub fn early_lambda_range(self, early_lambda_range: f32) -> Self

LemLib-TitanTron: run the early lambda once the angle to the target is at most this many degrees (signed error, as in TitanTron).

Parameters

Prop

Type

Returns

Self

View source

params

pub fn params(self, params: SwingToHeadingParams) -> Self

Replace the complete movement options.

Parameters

Prop

Type

Returns

Self

View source

run_async

pub fn run_async(self, run_async: bool) -> Self

Run in the background when true (default). With false, await completion.

Parameters

Prop

Type

Returns

Self

View source

early_lambda

pub fn early_lambda<F, Fut>(self, lambda: F) -> Self where F: Fn() -> Fut + 'static, Fut: Future<Output = ()> + 'static

Run a callback once when the early lambda range is reached.

Parameters

Prop

Type

Returns

Self

View source

set_early_lambda

pub fn set_early_lambda(self, lambda: Option<EarlyLambda>) -> Self

Set or clear the callback.

Parameters

Prop

Type

Returns

Self

View source