Class PinpointOdometry
java.lang.Object
com.crossbotics.ftchelper.odometry.PoseTracker
com.crossbotics.ftchelper.odometry.PinpointOdometry
- All Implemented Interfaces:
Subsystem
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
ConstructorsConstructorDescriptionPinpointOdometry(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 TypeMethodDescriptioncom.qualcomm.hardware.gobilda.GoBildaPinpointDriverdevice()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
-
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 namepinpoint- 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 useticksPerMmticksPerMm- encoder counts per mm, for other pods (ignored whenpodsis given)xReversed- the X pod counts down when the robot drives forwardyReversed- the Y pod counts down when the robot moves left
-
-
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.gobilda.GoBildaPinpointDriver device()The device, for anything this class does not cover.
-