Class PretendPinpoint
java.lang.Object
com.qualcomm.robotcore.hardware.I2cDeviceSynchDevice<com.qualcomm.robotcore.hardware.I2cDeviceSynchSimple>
com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
com.crossbotics.ftchelper.testkit.PretendPinpoint
- All Implemented Interfaces:
com.qualcomm.robotcore.hardware.HardwareDevice,com.qualcomm.robotcore.hardware.usb.RobotArmingStateNotifier.Callback
public class PretendPinpoint
extends com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
A pretend goBILDA Pinpoint (odometry computer) for JUnit tests: it says the robot is where your test
puts it. Get it from
PretendDevices.pinpoint(String); a robot with
odometry(Odometry.pinpoint("pinpoint")) gets it at INIT.
devices.pinpoint("pinpoint").moveTo(10, 0, 90); // the device's own frame: x forward, y left (inches, degrees)
Docs: docs/modules/testkit.md-
Nested Class Summary
Nested classes/interfaces inherited from class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.DeviceStatus, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.ErrorDetectionType, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.ReadData, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.RegisterNested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice
com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturer -
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.doubleWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.doubleWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.Fields inherited from class com.qualcomm.robotcore.hardware.I2cDeviceSynchDevice
deviceClient, deviceClientIsOwned, isInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.qualcomm.hardware.gobilda.GoBildaPinpointDriver.DeviceStatusintintdoublegetHeading(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit) doublegetHeading(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit) doublegetHeadingVelocity(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit) com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturerorg.firstinspires.ftc.robotcore.external.navigation.Pose2DdoublegetPosX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) doublegetPosY(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) doublegetVelX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) doublegetVelY(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) moveTo(double xIn, double yIn, double headingDegrees) Puts the device's pose here (its own frame: x forward, y left, inches; heading degrees).voidvoidvoidsetEncoderDirections(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection xEncoder, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection yEncoder) voidsetEncoderResolution(double ticksPerUnit, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) voidsetEncoderResolution(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods) voidsetOffsets(double xOffset, double yOffset, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit) voidsetPosition(org.firstinspires.ftc.robotcore.external.navigation.Pose2D pos) voidupdate()voidupdate(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.ReadData data) Methods inherited from class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
doInitialize, getDeviceID, getDeviceVersion, getFrequency, getLoopTime, getPitch, getQuaternion, getRoll, getXOffset, getYawScalar, getYOffset, setBulkReadScope, setErrorDetectionType, setHeading, setPosX, setPosY, setYawScalarMethods inherited from class com.qualcomm.robotcore.hardware.I2cDeviceSynchDevice
close, disengage, engage, getConnectionInfo, getDeviceClient, getVersion, initialize, initializeIfNecessary, onModuleStateChange, registerArmingStateCallback, resetDeviceConfigurationForOpMode
-
Field Details
-
x
public double xWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise. -
y
public double yWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise. -
headingDeg
public double headingDegWhere the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.
-
-
Constructor Details
-
PretendPinpoint
public PretendPinpoint()A pretend Pinpoint at 0, 0, 0.
-
-
Method Details
-
moveTo
Puts the device's pose here (its own frame: x forward, y left, inches; heading degrees). -
update
public void update()- Overrides:
updatein classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
update
public void update(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.ReadData data) - Overrides:
updatein classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
setEncoderResolution
public void setEncoderResolution(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods) - Overrides:
setEncoderResolutionin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
setEncoderDirections
public void setEncoderDirections(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection xEncoder, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection yEncoder) - Overrides:
setEncoderDirectionsin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
resetPosAndIMU
public void resetPosAndIMU()- Overrides:
resetPosAndIMUin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
recalibrateIMU
public void recalibrateIMU()- Overrides:
recalibrateIMUin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getDeviceStatus
public com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.DeviceStatus getDeviceStatus()- Overrides:
getDeviceStatusin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getEncoderX
public int getEncoderX()- Overrides:
getEncoderXin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getEncoderY
public int getEncoderY()- Overrides:
getEncoderYin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getPosition
public org.firstinspires.ftc.robotcore.external.navigation.Pose2D getPosition()- Overrides:
getPositionin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getDeviceName
- Specified by:
getDeviceNamein interfacecom.qualcomm.robotcore.hardware.HardwareDevice- Overrides:
getDeviceNamein classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-
getManufacturer
public com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturer getManufacturer()- Specified by:
getManufacturerin interfacecom.qualcomm.robotcore.hardware.HardwareDevice- Overrides:
getManufacturerin classcom.qualcomm.hardware.gobilda.GoBildaPinpointDriver
-