import edu.wpi.first.wpilibj.command.PIDSubsystem;
public class DriveTrain extends PIDSubsystem {
+ // Determines if the "front" of the robot has been reversed
private boolean outputFlipped = false;
+
private static double pidOutput = 0;
private Encoder leftEncoder, rightEncoder;
return getAvgEncoderDistance();
}
- public void joystickDrive(double left, double right) {
- int type = Constants.DriveTrain.DRIVE_TYPE;
+ public void drive(double left, double right) {
+ // Handle flipping of the "front" of the robot
double k = (isFlipped() ? -1 : 1);
- if (type == Constants.DriveTrain.TANK) {
- robotDrive.tankDrive(-left * k, -right * k);
- } else if (type == Constants.DriveTrain.ARCADE) {
- robotDrive.arcadeDrive(left * k, right);
- }
+
+ // During teleop, leftY is throttle, rightX is twist.
+ robotDrive.arcadeDrive(-left * k, -right * k);
}
public void setMotorSpeeds(double left, double right) {