Class OtosOdometry
java.lang.Object
com.crossbotics.ftchelper.odometry.PoseTracker
com.crossbotics.ftchelper.odometry.OtosOdometry
- All Implemented Interfaces:
Subsystem
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
ConstructorsConstructorDescriptionOtosOdometry(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 TypeMethodDescriptioncom.qualcomm.hardware.sparkfun.SparkFunOTOSdevice()The device, for anything this class does not cover.booleanisReady()True when the device works and gives a pose (not calibrating, no fault).kind()What kind it is, e.g.protected double[]read()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}.status()"ready", "calibrating", "Y pod not found"...protected voidwrite(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
-
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 nameotos- 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 frontlinearScalar- 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:PoseTrackerThe 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:
readin classPoseTracker
-
write
protected void write(double xIn, double yIn, double headingDeg) Description copied from class:PoseTrackerSets the device's pose in its own frame (X forward in, Y left in, heading CCW deg).- Specified by:
writein classPoseTracker
-
isReady
public boolean isReady()Description copied from class:PoseTrackerTrue when the device works and gives a pose (not calibrating, no fault).- Specified by:
isReadyin classPoseTracker
-
status
Description copied from class:PoseTracker"ready", "calibrating", "Y pod not found"... for the Driver Station.- Specified by:
statusin classPoseTracker
-
kind
Description copied from class:PoseTrackerWhat kind it is, e.g. "Pinpoint".- Specified by:
kindin classPoseTracker
-
device
public com.qualcomm.hardware.sparkfun.SparkFunOTOS device()The device, for anything this class does not cover.
-