Table of Contents

Class Odometry

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Tracks a robot's pose by adding up its motion.

public sealed class Odometry : IDisposable
Inheritance
Odometry
Implements
Inherited Members

Remarks

Each step is integrated as the exact arc the robot drives, so a robot that drives and turns at once follows its curve rather than cutting the corner. A speed, rate, time step, or distance that is not a finite number is ignored.

Constructors

Odometry(Pose)

Creates an estimate starting at a known pose.

public Odometry(Pose start = default)

Parameters

start Pose

The starting pose, the origin facing along x unless given.

Properties

Pose

Gets the pose so far.

public Pose Pose { get; }

Property Value

Pose

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FuseHeading(float, float)

Nudges the heading toward an absolute measurement, the way a compass tames gyro drift.

public void FuseHeading(float measured, float weight)

Parameters

measured float

The absolute heading in radians.

weight float

How strongly to trust it, from 0, ignore it, to 1, take it outright.

Integrate(float, float, float)

Adds a forward speed and yaw rate held for a time step.

public Pose Integrate(float linear, float angular, float dt)

Parameters

linear float

The forward speed.

angular float

The yaw rate, positive turning left.

dt float

The length of the step.

Returns

Pose

The new pose.

IntegrateWheels(float, float, DiffDrive)

Adds the distances two wheels rolled, through a differential drive.

public Pose IntegrateWheels(float left, float right, DiffDrive drive)

Parameters

left float

The distance the left wheel rolled since the last update.

right float

The distance the right wheel rolled since the last update.

drive DiffDrive

The drive, for the track between the wheels.

Returns

Pose

The new pose.

Reset(Pose)

Sets the estimate to a known pose.

public void Reset(Pose pose)

Parameters

pose Pose

The pose to set.