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.Register

    Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

    com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    Where the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.
    double
    Where the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.
    double
    Where 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
    Constructor
    Description
    A pretend Pinpoint at 0, 0, 0.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.DeviceStatus
     
    int
     
    int
     
    double
    getHeading(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit)
     
    double
    getHeading(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit)
     
    double
    getHeadingVelocity(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit)
     
    com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturer
     
    org.firstinspires.ftc.robotcore.external.navigation.Pose2D
     
    double
    getPosX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
     
    double
    getPosY(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
     
    double
    getVelX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
     
    double
    getVelY(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).
    void
     
    void
     
    void
    setEncoderDirections(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection xEncoder, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection yEncoder)
     
    void
    setEncoderResolution(double ticksPerUnit, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
     
    void
    setEncoderResolution(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods)
     
    void
    setOffsets(double xOffset, double yOffset, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
     
    void
    setPosition(org.firstinspires.ftc.robotcore.external.navigation.Pose2D pos)
     
    void
     
    void
    update(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, setYawScalar

    Methods inherited from class com.qualcomm.robotcore.hardware.I2cDeviceSynchDevice

    close, disengage, engage, getConnectionInfo, getDeviceClient, getVersion, initialize, initializeIfNecessary, onModuleStateChange, registerArmingStateCallback, resetDeviceConfigurationForOpMode

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      public double x
      Where the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.
    • y

      public double y
      Where the device says it is, in its own frame: x inches forward, y inches left, heading degrees counterclockwise.
    • headingDeg

      public double headingDeg
      Where 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

      public PretendPinpoint moveTo(double xIn, double yIn, double headingDegrees)
      Puts the device's pose here (its own frame: x forward, y left, inches; heading degrees).
    • update

      public void update()
      Overrides:
      update in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • update

      public void update(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.ReadData data)
      Overrides:
      update in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • setOffsets

      public void setOffsets(double xOffset, double yOffset, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      setOffsets in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • setEncoderResolution

      public void setEncoderResolution(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.GoBildaOdometryPods pods)
      Overrides:
      setEncoderResolution in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • setEncoderResolution

      public void setEncoderResolution(double ticksPerUnit, org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      setEncoderResolution in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • setEncoderDirections

      public void setEncoderDirections(com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection xEncoder, com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.EncoderDirection yEncoder)
      Overrides:
      setEncoderDirections in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • resetPosAndIMU

      public void resetPosAndIMU()
      Overrides:
      resetPosAndIMU in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • recalibrateIMU

      public void recalibrateIMU()
      Overrides:
      recalibrateIMU in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getPosX

      public double getPosX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      getPosX in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getPosY

      public double getPosY(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      getPosY in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getHeading

      public double getHeading(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit)
      Overrides:
      getHeading in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getHeading

      public double getHeading(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit)
      Overrides:
      getHeading in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getVelX

      public double getVelX(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      getVelX in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getVelY

      public double getVelY(org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit unit)
      Overrides:
      getVelY in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getHeadingVelocity

      public double getHeadingVelocity(org.firstinspires.ftc.robotcore.external.navigation.UnnormalizedAngleUnit unit)
      Overrides:
      getHeadingVelocity in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getDeviceStatus

      public com.qualcomm.hardware.gobilda.GoBildaPinpointDriver.DeviceStatus getDeviceStatus()
      Overrides:
      getDeviceStatus in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getEncoderX

      public int getEncoderX()
      Overrides:
      getEncoderX in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getEncoderY

      public int getEncoderY()
      Overrides:
      getEncoderY in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getPosition

      public org.firstinspires.ftc.robotcore.external.navigation.Pose2D getPosition()
      Overrides:
      getPosition in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • setPosition

      public void setPosition(org.firstinspires.ftc.robotcore.external.navigation.Pose2D pos)
      Overrides:
      setPosition in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getDeviceName

      public String getDeviceName()
      Specified by:
      getDeviceName in interface com.qualcomm.robotcore.hardware.HardwareDevice
      Overrides:
      getDeviceName in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver
    • getManufacturer

      public com.qualcomm.robotcore.hardware.HardwareDevice.Manufacturer getManufacturer()
      Specified by:
      getManufacturer in interface com.qualcomm.robotcore.hardware.HardwareDevice
      Overrides:
      getManufacturer in class com.qualcomm.hardware.gobilda.GoBildaPinpointDriver