Class Wheel

java.lang.Object
com.pocolifo.robobase.motor.Motor
com.pocolifo.robobase.motor.Wheel
All Implemented Interfaces:
AutoCloseable

public class Wheel extends Motor
Represents a single wheel on the robot.
See Also:
  • Field Details

    • wheelDiameterCm

      public final double wheelDiameterCm
      The diameter of this wheel, in centimeters.
    • circumferenceCm

      public final double circumferenceCm
      The circumference of this wheel, in centimeters.
    • targetPosition

      public double targetPosition
      The target encoder position
  • Constructor Details

    • Wheel

      public Wheel(com.qualcomm.robotcore.hardware.DcMotor motor, double tickCount, double wheelDiameterCm)
      Instantiate a Wheel.
      Parameters:
      motor - The DcMotor that is associated with this Motor.
      tickCount - The number of ticks for a full revolution of this motor.
      wheelDiameterCm - The diameter of the wheel in real life, in centimeters.
  • Method Details

    • setDriveTarget

      public void setDriveTarget(double centimeters)
      Sets how far the motor should move (in centimeters).
      Parameters:
      centimeters - How far the motor should move, in centimeters. Negative values move the wheel in reverse, and positive values move the wheel forward.