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.

PinpointLocalizer implements the Localizer interface by wrapping GoBILDA’s GoBildaPinpointDriver. It reads X and Y position in millimetres and heading in radians directly from the Pinpoint odometry computer over I²C, and packages them into a Pose2d for the Follower. Because it depends on the FTC SDK’s hardware abstraction layer (GoBildaPinpointDriver, AngleUnit, DistanceUnit), the class lives in TeamCode rather than odyssey-core. Package: org.firstinspires.ftc.teamcode.odyssey.localization
Source location: TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odyssey/localization/PinpointLocalizer.java

Constructor

PinpointLocalizer(GoBildaPinpointDriver pinpointDriver)
constructor
Wraps an already-configured GoBildaPinpointDriver instance. Obtain the driver from hardwareMap and call resetPosAndIMU() on it before passing it here.
pinpointDriver
GoBildaPinpointDriver
required
A fully initialized GoBILDA Pinpoint driver retrieved via hardwareMap.get(GoBildaPinpointDriver.class, "localizer").

Methods

getPose()
Pose2d
Returns the current robot pose by querying the Pinpoint driver:
  • xpinpointDriver.getPosX(DistanceUnit.MM)
  • ypinpointDriver.getPosY(DistanceUnit.MM)
  • headingpinpointDriver.getHeading(AngleUnit.RADIANS)
All three values are passed to the Pose2d constructor, which normalizes heading to (−π, π].
update()
void
Calls pinpointDriver.update() to fetch the latest odometry data from the Pinpoint computer. Must be called once per loop iteration before getPose() or Follower.update().

Setup

The following excerpt from PushTest.java shows the canonical initialization pattern:
GoBildaPinpointDriver pinpoint =
    hardwareMap.get(GoBildaPinpointDriver.class, "localizer");
pinpoint.resetPosAndIMU();
PinpointLocalizer localizer = new PinpointLocalizer(pinpoint);
Call this inside your OpMode’s init() method. The hardware configuration name "localizer" must match the name assigned to the Pinpoint device in the robot controller configuration file. resetPosAndIMU() zeroes both the position odometry and the onboard IMU. Call it every time in init() so that the robot’s starting position is treated as the origin (0, 0, 0), regardless of where it was when powered on.

Verifying odometry with Push Test

Odyssey includes a dedicated TeleOp OpMode — Push Test Odometry — that streams live pose data to telemetry without driving the robot. Use it to validate your Pinpoint installation before running autonomous paths:
@TeleOp(name = "Push Test Odometry")
public class PushTest extends OpMode {
    private PinpointLocalizer localizer;

    @Override
    public void init() {
        GoBildaPinpointDriver goBildaPinpointDriver =
            hardwareMap.get(GoBildaPinpointDriver.class, "localizer");
        goBildaPinpointDriver.resetPosAndIMU();
        localizer = new PinpointLocalizer(goBildaPinpointDriver);
    }

    @Override
    public void loop() {
        localizer.update();
        Pose2d pose = localizer.getPose();
        telemetry.addData("X: ", pose.getX());
        telemetry.addData("Y: ", pose.getY());
        telemetry.addData("HEADING: ", pose.getHeading());
        telemetry.update();
    }
}
Run Push Test Odometry and push the robot manually along the x-axis, y-axis, and through a rotation. Confirm that X, Y, and heading on the Driver Station telemetry reflect actual physical movement before running any autonomous paths. Mismatched axis signs or a non-zeroed IMU will produce systematic errors in all path following.
PinpointLocalizer is located in TeamCode, not odyssey-core, because it directly imports FTC hardware classes (GoBildaPinpointDriver, AngleUnit, DistanceUnit) that are not available outside the FTC SDK environment. If you are not using the provided TeamCode module directly, copy the file into your own TeamCode package and adjust the import paths as needed.

Build docs developers (and LLMs) love