Table of Contents

Struct WaypointFollower

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Steers toward a waypoint: pivot toward it, then drive, slowing as the heading error grows.

public readonly record struct WaypointFollower : IEquatable<WaypointFollower>
Implements
Inherited Members

Constructors

WaypointFollower(float, double, float, float)

Steers toward a waypoint: pivot toward it, then drive, slowing as the heading error grows.

public WaypointFollower(float Cruise, double ArrivalM, float HeadingGain, float MaxAngular)

Parameters

Cruise float

The forward speed when pointed at the target; its magnitude is used.

ArrivalM double

How close, in meters, counts as arrived; its magnitude is used.

HeadingGain float

The yaw rate commanded per radian of heading error; its magnitude is used.

MaxAngular float

The largest yaw rate to command; its magnitude is used.

Properties

ArrivalM

How close, in meters, counts as arrived; its magnitude is used.

public double ArrivalM { get; init; }

Property Value

double

Cruise

The forward speed when pointed at the target; its magnitude is used.

public float Cruise { get; init; }

Property Value

float

HeadingGain

The yaw rate commanded per radian of heading error; its magnitude is used.

public float HeadingGain { get; init; }

Property Value

float

MaxAngular

The largest yaw rate to command; its magnitude is used.

public float MaxAngular { get; init; }

Property Value

float

Methods

Guide(Coordinate, float, Coordinate)

Produces the command from a position and a compass heading toward a target.

public Guidance Guide(Coordinate here, float headingDeg, Coordinate target)

Parameters

here Coordinate

The robot's position.

headingDeg float

The robot's heading in degrees clockwise from north.

target Coordinate

The waypoint.

Returns

Guidance

The guidance. Within the arrival radius its twist is zero; a heading or position that is not a finite number also gives a zero twist.