Class DeadWheelOdometry
java.lang.Object
com.crossbotics.ftchelper.odometry.PoseTracker
com.crossbotics.ftchelper.odometry.DeadWheelOdometry
- All Implemented Interfaces:
Subsystem
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 TypeMethodDescriptionbooleanisReady()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"...static DeadWheelOdometrythreeWheels(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.static DeadWheelOdometrytwoWheels(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 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, isPoseSet, name, pose, setHeading, setPose, speedInPerSec, turnDegPerSec, unsetPose, update, useClock, velocityX, velocityY
-
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: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
-