Package ftclib.sensor

Class FtcPinpointOdometry

java.lang.Object
ftclib.sensor.FtcPinpointOdometry
All Implemented Interfaces:
TrcDriveBaseOdometry

public class FtcPinpointOdometry extends Object implements TrcDriveBaseOdometry
This class implements a wrapper to the GoBilda Pinpoint Odometry Computer that supports two Odometry wheels and a built-in IMU.
  • Field Details

  • Constructor Details

    • FtcPinpointOdometry

      public FtcPinpointOdometry(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, String instanceName, FtcPinpointOdometry.Config config)
      Constructor: Creates an instance of the object.
      Parameters:
      hardwareMap - specifies the global hardware map.
      instanceName - specifies the instance name.
      config - specifies the sensor configuration.
    • FtcPinpointOdometry

      public FtcPinpointOdometry(String instanceName, FtcPinpointOdometry.Config config)
      Constructor: Creates an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      config - specifies the sensor configuration.
  • Method Details

    • toString

      @NonNull public String toString()
      This method returns the instance name.
      Overrides:
      toString in class Object
      Returns:
      instance name.
    • updateCache

      public void updateCache()
      This method is called once at the beginning of the INPUT_TASK loop. Odometry device can update their cache at this time.
      Specified by:
      updateCache in interface TrcDriveBaseOdometry
    • reset

      public void reset()
      This method resets the DriveBase position.
      Specified by:
      reset in interface TrcDriveBaseOdometry
    • getPosition

      public TrcPose2D getPosition()
      This method returns the DriveBase position.
      Specified by:
      getPosition in interface TrcDriveBaseOdometry
      Returns:
      DriveBase position.
    • setPosition

      public void setPosition(TrcPose2D pose)
      This method sets the DriveBase position.
      Specified by:
      setPosition in interface TrcDriveBaseOdometry
      Parameters:
      pose - specifies the DriveBase position.
    • getVelocity

      public TrcPose2D getVelocity()
      This method returns the DriveBase velocity.
      Specified by:
      getVelocity in interface TrcDriveBaseOdometry
      Returns:
      DriveBase velocity.