X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;h=1079d501a82fc4f52d281b0c8e96478a2a0653a9;hb=d9475515518368b284e5c5fb4e2463c8c082f62d;hp=a0134a43a7fbe0d6c792924c1da98dabff741c14;hpb=f675bae4f34fbfafac79bb38cced9ca96d025be8;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 a0134a43..1079d501 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot.subsystems; +import org.usfirst.frc.team3501.robot.CheesyDriveHelper; import org.usfirst.frc.team3501.robot.Constants; import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive; @@ -24,6 +25,8 @@ public class DriveTrain extends PIDSubsystem { private DoubleSolenoid leftGearPiston, rightGearPiston; + private CheesyDriveHelper cheese; + // Drivetrain specific constants that relate to the inches per pulse value for // the encoders @@ -57,6 +60,8 @@ public class DriveTrain extends PIDSubsystem { Constants.DriveTrain.RIGHT_SHIFT_MODULE, Constants.DriveTrain.RIGHT_SHIFT_FORWARD, Constants.DriveTrain.RIGHT_SHIFT_REVERSE); + + cheese = new CheesyDriveHelper(this); } @Override @@ -196,13 +201,14 @@ public class DriveTrain extends PIDSubsystem { public void joystickDrive(double left, double right) { // Handle flipping of the "front" of the robot double k = (isFlipped() ? -1 : 1); - - robotDrive.tankDrive(-left * k, -right * k); + cheese.cheesyDrive(-left * k, -right, + getGearPistonValue() == Constants.DriveTrain.HIGH_GEAR); } public void setMotorSpeeds(double left, double right) { double k = (isFlipped() ? -1 : 1); - robotDrive.tankDrive(-left * k, -right * k); + cheese.cheesyDrive(-left * k, -right, + getGearPistonValue() == Constants.DriveTrain.HIGH_GEAR); } /**