Struct QuadratureScale
Turns encoder steps into the distance and speed of the wheel they turn with.
public readonly record struct QuadratureScale : IEquatable<QuadratureScale>
- Implements
- Inherited Members
Constructors
QuadratureScale(float, float)
Turns encoder steps into the distance and speed of the wheel they turn with.
public QuadratureScale(float CountsPerRev, float WheelRadius)
Parameters
CountsPerRevfloatSteps per wheel revolution; its magnitude is used.
WheelRadiusfloatThe wheel radius in meters; its magnitude is used.
Properties
CountsPerRev
Steps per wheel revolution; its magnitude is used.
public float CountsPerRev { get; init; }
Property Value
WheelRadius
The wheel radius in meters; its magnitude is used.
public float WheelRadius { get; init; }
Property Value
Methods
Distance(long)
Returns the distance a wheel rolled for a step count.
public float Distance(long count)
Parameters
countlongThe signed step count.
Returns
- float
The distance in meters, or 0 for a scale with no resolution.
Velocity(long, float)
Returns a wheel's speed from the steps counted over a time step.
public float Velocity(long deltaCount, float dt)
Parameters
Returns
- float
The speed in meters per second, or 0 when
dtis 0.