pub struct TrackingWheel<T: RotarySensor> {
pub sensor: T,
pub wheel_diameter: f64,
pub offset: f64,
pub gearing: Option<f64>,
}Expand description
A wheel attached to a rotary sensor for position tracking.
Fields§
§sensor: TRotary sensor for measuring the wheel’s travel.
wheel_diameter: f64Diameter of the wheel.
offset: f64Signed offset from the drivetrain’s center of rotation.
Negative offset implies that the wheel is left or behind
the center of rotation.
gearing: Option<f64>External gearing of the wheel.
Used as a multiplier when determining wheel travel.
Implementations§
Source§impl<T: RotarySensor> TrackingWheel<T>
impl<T: RotarySensor> TrackingWheel<T>
Sourcepub const fn new(
sensor: T,
wheel_diameter: f64,
offset: f64,
gearing: Option<f64>,
) -> Self
pub const fn new( sensor: T, wheel_diameter: f64, offset: f64, gearing: Option<f64>, ) -> Self
Creates a new tracking wheel with the given parameters.
§Parameters
sensor- The rotary sensor to read wheel rotation from.wheel_diameter- The diameter of the wheel in linear units.offset- Distance from wheel to robot’s center of rotation.gearing- Optional gear ratio between sensor and wheel (use None for 1:1 if ungeared).
Trait Implementations§
Source§impl<T: Clone + RotarySensor> Clone for TrackingWheel<T>
impl<T: Clone + RotarySensor> Clone for TrackingWheel<T>
Source§fn clone(&self) -> TrackingWheel<T>
fn clone(&self) -> TrackingWheel<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + RotarySensor> Debug for TrackingWheel<T>
impl<T: Debug + RotarySensor> Debug for TrackingWheel<T>
Source§impl<T: PartialEq + RotarySensor> PartialEq for TrackingWheel<T>
impl<T: PartialEq + RotarySensor> PartialEq for TrackingWheel<T>
impl<T: RotarySensor> StructuralPartialEq for TrackingWheel<T>
Auto Trait Implementations§
impl<T> Freeze for TrackingWheel<T>where
T: Freeze,
impl<T> RefUnwindSafe for TrackingWheel<T>where
T: RefUnwindSafe,
impl<T> Send for TrackingWheel<T>where
T: Send,
impl<T> Sync for TrackingWheel<T>where
T: Sync,
impl<T> Unpin for TrackingWheel<T>where
T: Unpin,
impl<T> UnwindSafe for TrackingWheel<T>where
T: 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