SwingToHeading
vectorlib::SwingToHeading — fields, methods, parameters and return types.
pub struct SwingToHeading<'a>Builder returned by Chassis::swing_to_heading.
Methods
Prop
Type
direction
pub fn direction(self, direction: super::AngularDirection) -> SelfThe direction to turn in. Auto by default.
Parameters
Prop
Type
Returns
Selfmax_speed
pub fn max_speed(self, max_speed: f32) -> SelfMaximum speed, 0-127. 127 by default.
Parameters
Prop
Type
Returns
Selfmin_speed
pub fn min_speed(self, min_speed: f32) -> SelfMinimum speed, 0-127. Non-zero switches to motion-chaining exit conditions.
Parameters
Prop
Type
Returns
Selfearly_exit_range
pub fn early_exit_range(self, early_exit_range: f32) -> SelfExit when within this many degrees. Only used when min_speed is non-zero.
Parameters
Prop
Type
Returns
Selfearly_lambda_range
pub fn early_lambda_range(self, early_lambda_range: f32) -> SelfLemLib-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
Selfparams
pub fn params(self, params: SwingToHeadingParams) -> SelfReplace the complete movement options.
Parameters
Prop
Type
Returns
Selfrun_async
pub fn run_async(self, run_async: bool) -> SelfRun in the background when true (default). With false, await completion.
Parameters
Prop
Type
Returns
Selfearly_lambda
pub fn early_lambda<F, Fut>(self, lambda: F) -> Self where F: Fn() -> Fut + 'static, Fut: Future<Output = ()> + 'staticRun a callback once when the early lambda range is reached.
Parameters
Prop
Type
Returns
Selfset_early_lambda
pub fn set_early_lambda(self, lambda: Option<EarlyLambda>) -> SelfSet or clear the callback.
Parameters
Prop
Type
Returns
Self