Class OtosOdometry

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

public final class OtosOdometry extends PoseTracker
Odometry from a SparkFun OTOS (Optical Tracking Odometry Sensor): a camera-like sensor under the robot that watches the floor move, with its own IMU. No wheels. It must sit 10 to 12 mm above the tiles.

Settings: where it sits on the robot (see OtosOdometry(java.lang.String, com.qualcomm.hardware.sparkfun.SparkFunOTOS, double, double, double, double, double)), and two scale numbers the Odometry Tuner measures: linear (distance) and angular (turning).

The OTOS's own axes (the SDK's sample): x = to the robot's RIGHT, y = FORWARD, heading counterclockwise +. This class turns them into the library's frame. Docs: docs/modules/odometry.md

  • Constructor Summary

    Constructors
    Constructor
    Description
    OtosOdometry(String name, com.qualcomm.hardware.sparkfun.SparkFunOTOS otos, double forwardIn, double leftIn, double headingDeg, double linearScalar, double angularScalar)
    Sets the OTOS up, calibrates its IMU and zeroes it (the robot must be still; INIT is).
  • Method Summary

    Modifier and Type
    Method
    Description
    com.qualcomm.hardware.sparkfun.SparkFunOTOS
    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

    • OtosOdometry

      public OtosOdometry(String name, com.qualcomm.hardware.sparkfun.SparkFunOTOS otos, double forwardIn, double leftIn, double headingDeg, double linearScalar, double angularScalar)
      Sets the OTOS up, calibrates its IMU and zeroes it (the robot must be still; INIT is).
      Parameters:
      name - the configuration name
      otos - the device (hardwareMap.get(SparkFunOTOS.class, name))
      forwardIn - how far FORWARD of the robot's centre it sits (back = negative)
      leftIn - how far LEFT of the centre it sits (right = negative)
      headingDeg - which way its arrow points, counterclockwise from the robot's front
      linearScalar - distance scale (1.0 until the tuner measures it; 0.872 to 1.127)
      angularScalar - turn scale (1.0 until the tuner measures it; 0.872 to 1.127)
  • 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.sparkfun.SparkFunOTOS device()
      The device, for anything this class does not cover.