Class PinpointOdometry

java.lang.Object
com.crossbotics.ftchelper.odometry.PoseTracker
com.crossbotics.ftchelper.odometry.PinpointOdometry
All Implemented Interfaces:
Subsystem

public final class PinpointOdometry extends PoseTracker
Odometry from a goBILDA Pinpoint: a small computer on an I2C port that reads two odometry pods and its own IMU and works out the pose itself, about 1500 times a second. The library only reads the answer once per loop.

 // In Robot.java (the robot layer does this for you):
 odometry(Odometry.pinpoint("pinpoint").offsetsMm(-84, -168));   // 4-bar pods unless .podsSwingarm()
 

The offsets (from the SDK): x = how far to the LEFT of the robot's centre the forward-measuring (X) pod is, y = how far FORWARD of the centre the sideways-measuring (Y) pod is, in mm. The Odometry Tuner measures them. Docs: docs/modules/odometry.md

  • Constructor Summary

    Constructors
    Constructor
    Description
    PinpointOdometry(String name, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver pinpoint, double xOffsetMm, double yOffsetMm, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods, double ticksPerMm, boolean xReversed, boolean yReversed)
    Sets the Pinpoint up and zeroes it (the robot must be still for about a quarter second; INIT is).
  • Method Summary

    Modifier and Type
    Method
    Description
    com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    The device, for anything this class does not cover.
    boolean
    True when the device works and gives a pose (not calibrating, no fault).
    What kind it is, e.g.
    protected double[]
    The device's pose in its own frame: {X forward in, Y left in, heading CCW deg}, plus, if it knows, {vX in/s, vY in/s, turn deg/s}.
    "ready", "calibrating", "Y pod not found"...
    protected void
    write(double xIn, double yIn, double headingDeg)
    Sets the device's pose in its own frame (X forward in, Y left in, heading CCW deg).

    Methods inherited from class com.crossbotics.ftchelper.odometry.PoseTracker

    addTelemetry, name, pose, setPose, speedInPerSec, turnDegPerSec, update

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.crossbotics.ftchelper.core.Subsystem

    stop
  • Constructor Details

    • PinpointOdometry

      public PinpointOdometry(String name, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver pinpoint, double xOffsetMm, double yOffsetMm, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods, double ticksPerMm, boolean xReversed, boolean yReversed)
      Sets the Pinpoint up and zeroes it (the robot must be still for about a quarter second; INIT is).
      Parameters:
      name - the configuration name
      pinpoint - the device (hardwareMap.get(GoBildaPinpointDriver.class, name))
      xOffsetMm - the X pod's distance LEFT of the centre (right = negative)
      yOffsetMm - the Y pod's distance FORWARD of the centre (back = negative)
      pods - goBILDA 4-bar or swingarm pods, or null to use ticksPerMm
      ticksPerMm - encoder counts per mm, for other pods (ignored when pods is given)
      xReversed - the X pod counts down when the robot drives forward
      yReversed - the Y pod counts down when the robot moves left
  • Method Details

    • read

      protected double[] read()
      Description copied from class: PoseTracker
      The device's pose in its own frame: {X forward in, Y left in, heading CCW deg}, plus, if it knows, {vX in/s, vY in/s, turn deg/s}. Null if there is nothing new.
      Specified by:
      read in class PoseTracker
    • write

      protected void write(double xIn, double yIn, double headingDeg)
      Description copied from class: PoseTracker
      Sets the device's pose in its own frame (X forward in, Y left in, heading CCW deg).
      Specified by:
      write in class PoseTracker
    • isReady

      public boolean isReady()
      Description copied from class: PoseTracker
      True when the device works and gives a pose (not calibrating, no fault).
      Specified by:
      isReady in class PoseTracker
    • status

      public String status()
      Description copied from class: PoseTracker
      "ready", "calibrating", "Y pod not found"... for the Driver Station.
      Specified by:
      status in class PoseTracker
    • kind

      public String kind()
      Description copied from class: PoseTracker
      What kind it is, e.g. "Pinpoint".
      Specified by:
      kind in class PoseTracker
    • device

      public com.qualcomm.hardware.gobilda.GoBildaPinpointDriver device()
      The device, for anything this class does not cover.