X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;h=de2626bed86e43a5e5fdddde5eca8ab2374f471b;hb=2a099bc6e824accc4ea0df2db2f6af666cf9aad4;hp=5e9f2bd93daaea7817f8b2951580351b1fa80a5c;hpb=d9c04720cc5bfc1cafab0c73e71dd231bbc65ff7;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 5e9f2bd9..de2626be 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -8,12 +8,15 @@ import org.usfirst.frc.team3501.robot.commands.driving.JoystickDrive; import edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.CounterBase.EncodingType; import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.RobotDrive; import edu.wpi.first.wpilibj.command.PIDSubsystem; public class DriveTrain extends PIDSubsystem { + private static double kp = 0.013, ki = 0.000015, kd = -0.002; + private static double gp = 0.018, gi = 0.000015, gd = 0; private static double pidOutput = 0; private static double encoderTolerance = 8.0, gyroTolerance = 5.0; private int DRIVE_MODE = 1; @@ -262,6 +265,24 @@ public class DriveTrain extends PIDSubsystem { rearRight.set(right); } - private static double kp = 0.013, ki = 0.000015, kd = -0.002; - private static double gp = 0.018, gi = 0.000015, gd = 0; + public Value getLeftGearPistonValue() { + return leftGearPiston.get(); + } + + public Value getRightGearPistonValue() { + return rightGearPiston.get(); + } + + public void setHighGear() { + changeGear(Constants.DriveTrain.HIGH_GEAR); + } + + public void setLowGear() { + changeGear(Constants.DriveTrain.LOW_GEAR); + } + + public void changeGear(DoubleSolenoid.Value gear) { + leftGearPiston.set(gear); + rightGearPiston.set(gear); + } }