Struct WaypointFollower
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
CruisefloatThe forward speed when pointed at the target; its magnitude is used.
ArrivalMdoubleHow close, in meters, counts as arrived; its magnitude is used.
HeadingGainfloatThe yaw rate commanded per radian of heading error; its magnitude is used.
MaxAngularfloatThe 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
Cruise
The forward speed when pointed at the target; its magnitude is used.
public float Cruise { get; init; }
Property Value
HeadingGain
The yaw rate commanded per radian of heading error; its magnitude is used.
public float HeadingGain { get; init; }
Property Value
MaxAngular
The largest yaw rate to command; its magnitude is used.
public float MaxAngular { get; init; }
Property Value
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
hereCoordinateThe robot's position.
headingDegfloatThe robot's heading in degrees clockwise from north.
targetCoordinateThe 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.