public class TankDrive extends MecanumDrive
TankDrive
is a DriveSystem
that represents a standard tank drive
system, with standard parallel wheels on both sides of the robot.
The TankDrive
class is a subclass of MecanumDrive
for technical reasons.
The code that controls a tank drive system is exactly the same as the code that controls
a mecanum drive system, with the one difference being that the strafing vector must be
zero if the physical robot does not use mecanum drive. The inheritance relationship is
purely functional, not symbolic.
DRIVE_POWER_WEIGHT, MOVE_POWER_SCALE, ROTATE_POWER_WEIGHT, STRAFE_POWER_WEIGHT
Constructor and Description |
---|
TankDrive(MotorSet wheels)
Constructs a new
TankDrive with the given DriveMotorSet as a base. |
TankDrive(java.lang.String[] motornames)
Constructs a new
TankDrive that uses the motors with the given names. |
Modifier and Type | Method and Description |
---|---|
boolean |
setMovement(double forward,
double right,
double clockwise)
Deprecated.
A tank drive system cannot accept a right-facing vector as an argument
for movement. The purpose of this method is only to filter out any possible
right-facing, non-zero vector argument to prevent damage to the physical motors.
Instead of this method, use the two-argument version, which accepts only forward and
clockwise vectors. This method is declared in |
getDriveTicks, getRotateTicks, getSwingTicks, setMovement, strafe, strafeSeconds, traverse, traverseSeconds
drive, driveInches, driveSeconds, driveTicks, getDriveInches, getMotorSet, getRotationDegrees, getSwingDegrees, halt, resetEncoders, rotate, rotateDegrees, rotateSeconds, rotateTicks, setEncoderTicksPerDriveInch, setEncoderTicksPerRotationDegree, setEncoderTicksPerSwingDegree, swing, swingDegrees, swingSeconds, swingTicks, waitAndStop
public TankDrive(MotorSet wheels)
TankDrive
with the given DriveMotorSet
as a base.wheels
- the DriveMotorSet
of this drive system.DriveSystem.DriveSystem(MotorSet)
public TankDrive(java.lang.String[] motornames)
TankDrive
that uses the motors with the given names.motornames
- the names of the motors to use with this drive system.DriveSystem.DriveSystem(String[])
@Deprecated public boolean setMovement(double forward, double right, double clockwise)
Instead of this method, use the two-argument version, which accepts only forward and
clockwise vectors. This method is declared in DriveSystem
and implemented in
MecanumDrive
.
MecanumDrive
setMovement
in class MecanumDrive
forward
- the forward-driving vector; between -1 and 1.right
- the right-strafing vector; between -1 and 1.clockwise
- the clockwise-spinning vector; between -1 and 1.