Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/saquer916/odyssey/llms.txt

Use this file to discover all available pages before exploring further.

Odyssey defines a HeadingInterpolator interface with four built-in implementations that control robot orientation independently of the translational cubic Bézier path. Because translation and rotation are decoupled, you can combine any heading strategy with any path shape — for example, keeping the robot pointed at a fixed target while it curves through a complex trajectory.

Interface: HeadingInterpolator

Package: org.firstinspires.ftc.teamcode.odyssey.path.heading
public interface HeadingInterpolator {
    double getHeading(double t, BezierCurve curve);
}
getHeading(double t, BezierCurve curve)
double
Returns the desired robot heading in radians at path parameter t.
t
double
required
Normalized path parameter in the range [0, 1]. 0 is the start of the segment; 1 is the end.
curve
BezierCurve
required
The active Bézier curve. Implementations that depend on current position or tangent direction query this object.

ConstantInterpolator

Holds a single fixed heading for the entire segment regardless of position or progress. Use this for sideways strafing segments or any manoeuvre where the robot must maintain a specific orientation throughout. Package: org.firstinspires.ftc.teamcode.odyssey.path.heading

Constructor

ConstantInterpolator(double heading)
constructor
heading
double
required
The constant heading to return for all values of t, in radians.

Example

// Robot faces 90° (field-left) for the entire segment
new ConstantInterpolator(Math.toRadians(90))

LinearInterpolator

Smoothly rotates the robot from startHeading to endHeading over the segment, proportional to t. The interpolation always takes the shortest angular path, handled by normalizing the angular delta with MathUtils.normalizeAngle. This means transitions like 170° → −170° (a 20° rotation) work correctly without spinning the wrong way. Package: org.firstinspires.ftc.teamcode.odyssey.path.heading

Constructor

LinearInterpolator(double startHeading, double endHeading)
constructor
startHeading
double
required
Heading at the beginning of the segment (t = 0), in radians.
endHeading
double
required
Heading at the end of the segment (t = 1), in radians.

Example

// Rotate 180° over the segment
new LinearInterpolator(0, Math.PI)

TangentInterpolator

Sets the heading equal to curve.getTangentAngle(t) so the robot always faces the direction of travel. This mimics the behaviour of a conventional differential-drive robot and is the natural choice for high-speed forward runs where facing the direction of motion minimises lateral error. Package: org.firstinspires.ftc.teamcode.odyssey.path.heading

Constructor

TangentInterpolator()
constructor
No parameters. The heading is derived entirely from the curve’s tangent at each t.

Example

new TangentInterpolator()

FaceTargetInterpolator

Continuously rotates the robot to face a fixed field-frame point regardless of where the robot is along the path. At each t, it evaluates curve.getPoint(t) and computes the bearing to the target via Math.atan2. Use this when a sensor (e.g. a camera or distance sensor) mounted on the front of the robot must track a landmark continuously during motion. Package: org.firstinspires.ftc.teamcode.odyssey.path.heading

Constructor

FaceTargetInterpolator(Vector2d target)
constructor
target
Vector2d
required
Fixed field-frame point to face at all times, in millimetres.

Example

// Always face the field point (1800, 1800)
new FaceTargetInterpolator(new Vector2d(1800, 1800))

Comparison

InterpolatorTypical use caseHeading depends on
ConstantInterpolatorSideways strafe, timed approachFixed angle — ignores t and curve
LinearInterpolatorSmooth rotation during transitPath progress t
TangentInterpolatorHigh-speed forward runsCurve tangent direction
FaceTargetInterpolatorCamera/sensor trackingCurrent field position on the curve
All angles are in radians throughout Odyssey. Use Math.toRadians() to convert from degrees when constructing interpolators, and Math.toDegrees() when displaying values in telemetry.

Build docs developers (and LLMs) love