Package com.pocolifo.robobase.motor
Class Wheel
java.lang.Object
com.pocolifo.robobase.motor.Motor
com.pocolifo.robobase.motor.Wheel
- All Implemented Interfaces:
AutoCloseable
Represents a single wheel on the robot.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
The circumference of this wheel, in centimeters.double
The target encoder positionfinal double
The diameter of this wheel, in centimeters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setDriveTarget
(double centimeters) Sets how far the motor should move (in centimeters).Methods inherited from class com.pocolifo.robobase.motor.Motor
close, drive, getMotorRotations, getPosition, stopMoving
-
Field Details
-
wheelDiameterCm
public final double wheelDiameterCmThe diameter of this wheel, in centimeters. -
circumferenceCm
public final double circumferenceCmThe circumference of this wheel, in centimeters. -
targetPosition
public double targetPositionThe target encoder position
-
-
Constructor Details
-
Wheel
public Wheel(com.qualcomm.robotcore.hardware.DcMotor motor, double tickCount, double wheelDiameterCm) Instantiate aWheel
.- Parameters:
motor
- TheDcMotor
that is associated with thisMotor
.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.
-