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: LLinear (forward driving) feedback controller.
angular_controller: AAngular (turning) feedback controller.
linear_tolerances: TolerancesLinear settling conditions.
angular_tolerances: TolerancesAngular settling conditions.
timeout: Option<Duration>Maximum duration the motion can take before being cancelled.
Implementations§
Source§impl<L, A> Basic<L, A>
impl<L, A> Basic<L, A>
Sourcepub 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> ⓘ
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.
Sourcepub 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> ⓘ
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.
Sourcepub 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> ⓘ
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.
Sourcepub 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> ⓘ
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.