Table of Contents

Struct QuadratureScale

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

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

CountsPerRev float

Steps per wheel revolution; its magnitude is used.

WheelRadius float

The 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

float

WheelRadius

The wheel radius in meters; its magnitude is used.

public float WheelRadius { get; init; }

Property Value

float

Methods

Distance(long)

Returns the distance a wheel rolled for a step count.

public float Distance(long count)

Parameters

count long

The 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

deltaCount long

The steps counted during the step.

dt float

The length of the step.

Returns

float

The speed in meters per second, or 0 when dt is 0.