Class Odometry
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
startPoseThe starting pose, the origin facing along x unless given.
Properties
Pose
Gets the pose so far.
public Pose Pose { get; }
Property Value
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
measuredfloatThe absolute heading in radians.
weightfloatHow 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
linearfloatThe forward speed.
angularfloatThe yaw rate, positive turning left.
dtfloatThe 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
leftfloatThe distance the left wheel rolled since the last update.
rightfloatThe distance the right wheel rolled since the last update.
driveDiffDriveThe 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
posePoseThe pose to set.