pub struct Basic<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = 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: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> Basic<L, A>
impl<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> Basic<L, A>
Sourcepub fn drive_distance_at_heading<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>(
&mut self,
drivetrain: &'a mut Drivetrain<Differential, T>,
target_distance: f64,
target_heading: Angle,
) -> DriveDistanceAtHeadingFuture<'a, L, A, T> ⓘ
pub fn drive_distance_at_heading<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, target_distance: f64, target_heading: Angle, ) -> DriveDistanceAtHeadingFuture<'a, 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, T: TracksForwardTravel + TracksHeading + TracksVelocity>(
&mut self,
drivetrain: &'a mut Drivetrain<Differential, T>,
distance: f64,
) -> DriveDistanceAtHeadingFuture<'a, L, A, T> ⓘ
pub fn drive_distance<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, distance: f64, ) -> DriveDistanceAtHeadingFuture<'a, 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, T: TracksForwardTravel + TracksHeading + TracksVelocity>(
&mut self,
drivetrain: &'a mut Drivetrain<Differential, T>,
heading: Angle,
) -> DriveDistanceAtHeadingFuture<'a, L, A, T> ⓘ
pub fn turn_to_heading<'a, T: TracksForwardTravel + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, heading: Angle, ) -> DriveDistanceAtHeadingFuture<'a, L, A, T> ⓘ
Turns the robot in place to face a heading.
Sourcepub fn turn_to_point<'a, T: TracksForwardTravel + TracksPosition + TracksHeading + TracksVelocity>(
&mut self,
drivetrain: &'a mut Drivetrain<Differential, T>,
point: impl Into<Vec2<f64>>,
) -> TurnToPointFuture<'a, L, A, T> ⓘ
pub fn turn_to_point<'a, T: TracksForwardTravel + TracksPosition + TracksHeading + TracksVelocity>( &mut self, drivetrain: &'a mut Drivetrain<Differential, T>, point: impl Into<Vec2<f64>>, ) -> TurnToPointFuture<'a, L, A, T> ⓘ
Turns the robot in place to face a 2D point.
Trait Implementations§
Source§impl<L: PartialEq + ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: PartialEq + ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> PartialEq for Basic<L, A>
impl<L: PartialEq + ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: PartialEq + ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> PartialEq for Basic<L, A>
impl<L: ControlLoop<Input = f64, Output = f64> + Unpin + Clone, A: ControlLoop<Input = Angle, Output = f64> + Unpin + Clone> StructuralPartialEq for Basic<L, A>
Auto Trait Implementations§
impl<L, A> Freeze for Basic<L, A>
impl<L, A> RefUnwindSafe for Basic<L, A>where
L: RefUnwindSafe,
A: RefUnwindSafe,
impl<L, A> Send for Basic<L, A>
impl<L, A> Sync for Basic<L, A>
impl<L, A> Unpin for Basic<L, A>
impl<L, A> UnwindSafe for Basic<L, A>where
L: UnwindSafe,
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more