X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;h=f1daa63772ded83dc26599c42a098148c79129a3;hb=1b977a14046555f6ae3bb3d09cedf543e049ddc7;hp=1a4e6e5b96c04dfc58689e377aa2ec5ba9dd1ae8;hpb=949415d065993cac3fd0c271eb3ba5d6b5ec90af;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index 1a4e6e5b..f1daa637 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -193,36 +193,17 @@ public class DriveTrain extends PIDSubsystem { 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); - robotDrive.tankDrive(-left, -right); - - // if (type == Constants.DriveTrain.TANK) { - // // TODO Test this for negation and for voltage vs. [-1,1] outputs - // double leftSpeed = (-frontLeft.get() + -rearLeft.get()) / 2; - // double rightSpeed = (-frontRight.get() + -rearRight.get()) / 2; - // left = ((Constants.DriveTrain.kADJUST - 1) * leftSpeed + left) - // / Constants.DriveTrain.kADJUST; - // right = ((Constants.DriveTrain.kADJUST - 1) * rightSpeed + right) - // / Constants.DriveTrain.kADJUST; - // robotDrive.tankDrive(-left * k, -right * k); - // } else if (type == Constants.DriveTrain.ARCADE) { - // double speed = (-frontLeft.get() + -rearLeft.get() + -frontRight.get() + - // -rearRight - // .get()) / 2; - // left = ((Constants.DriveTrain.kADJUST - 1) * speed + left) - // / Constants.DriveTrain.kADJUST; - // 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) { double k = (isFlipped() ? -1 : 1); - robotDrive.tankDrive(-left, -right); + robotDrive.tankDrive(-left * k, -right * k); } /**