Class DeadWheelOdometry

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

public final class DeadWheelOdometry extends PoseTracker
Odometry from dead wheels: unpowered omni wheels ("pods") on encoder ports. Three wheels: two that measure forward (left and right) and one that measures sideways. Two wheels: one forward, one sideways, and the heading from the IMU. The library works out the pose from the wheels' changes every loop.

The pods plug into a motor port's encoder (the motor on that port can still be used); the library only reads the count. Docs: docs/modules/odometry.md

  • Method Summary

    Modifier and Type
    Method
    Description
    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"...
    threeWheels(String name, com.qualcomm.robotcore.hardware.DcMotorEx left, com.qualcomm.robotcore.hardware.DcMotorEx right, com.qualcomm.robotcore.hardware.DcMotorEx perp, double ticksPerIn, double trackWidthIn, double perpForwardIn, boolean leftReversed, boolean rightReversed, boolean perpReversed)
    Three wheels.
    twoWheels(String name, com.qualcomm.robotcore.hardware.DcMotorEx parallel, com.qualcomm.robotcore.hardware.DcMotorEx perp, DoubleSupplier imuHeadingDeg, double ticksPerIn, double parallelLeftIn, double perpForwardIn, boolean parallelReversed, boolean perpReversed)
    Two wheels and the IMU.
    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, isPoseSet, name, pose, setHeading, setPose, speedInPerSec, turnDegPerSec, unsetPose, update, useClock, velocityX, velocityY

    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
  • Method Details

    • threeWheels

      public static DeadWheelOdometry threeWheels(String name, com.qualcomm.robotcore.hardware.DcMotorEx left, com.qualcomm.robotcore.hardware.DcMotorEx right, com.qualcomm.robotcore.hardware.DcMotorEx perp, double ticksPerIn, double trackWidthIn, double perpForwardIn, boolean leftReversed, boolean rightReversed, boolean perpReversed)
      Three wheels. Distances in inches; ticksPerIn = encoder counts per inch of the pod wheel.
    • twoWheels

      public static DeadWheelOdometry twoWheels(String name, com.qualcomm.robotcore.hardware.DcMotorEx parallel, com.qualcomm.robotcore.hardware.DcMotorEx perp, DoubleSupplier imuHeadingDeg, double ticksPerIn, double parallelLeftIn, double perpForwardIn, boolean parallelReversed, boolean perpReversed)
      Two wheels and the IMU. parallelLeftIn: the forward pod's distance left of the centre.
    • 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