File-By-File
GoBildaPinpointLocalizer

GoBildaPinpointLocalizer

This class is an AbstractOdometry implementation that integrates with the goBILDA Pinpoint Odometry Computer to provide robot localization. It leverages the Pinpoint's sensor fusion capabilities to track the robot's position and heading.

Fields

PARAMS

A static inner class Params that holds configurable parameters for the GoBildaPinpointLocalizer.

  • xOffset: X-offset for the Pinpoint.
  • yOffset: Y-offset for the Pinpoint.
  • offsetUnit: The DistanceUnit for the offsets (e.g., DistanceUnit.MM).
  • resolution: The type of goBILDA Odometry Pods used (e.g., goBILDA_4_BAR_POD).
  • xDirection: The encoder direction for the X-axis.
  • yDirection: The encoder direction for the Y-axis.

Methods

GoBildaPinpointLocalizer(HardwareMap hm, String odo, PointXYZ startPose)

Constructs a new GoBildaPinpointLocalizer instance.

  • hm: The HardwareMap from the FTC robot configuration.
  • odo: The name of the Pinpoint device in the hardware map.
  • startPose: The initial PointXYZ of the robot. The Pinpoint's position will be set to this pose upon initialization.

This constructor also configures the Pinpoint driver with the offsets, encoder directions, and resolution specified in the PARAMS static class, resets the Pinpoint's position and IMU, and waits for a short calibration period.

tick()

Overrides the abstract method from AbstractOdometry. This method calls the update() method on the internal GoBildaPinpointDriverVoyager to refresh the Pinpoint's odometry data.

getRawPosition()

Overrides the abstract method from AbstractOdometry. This method retrieves the current position from the internal GoBildaPinpointDriverVoyager and returns it as a PointXYZ.

setOffset(PointXYZ pointXYZ)

Overrides the abstract method from AbstractOdometry. This method sets the Pinpoint's current position to the provided PointXYZ.