X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;h=a6a6f8c9ce7e7c7e434e144dcd316a3e3d35e8d9;hp=bad303aebe622f0db77aa8a41d45e79b92c68325;hb=fc01fb0fb74d31a0818c69d0306253deb4236c58;hpb=cb8e86cb498c12dcf4e2b7a5916fc6f4926b77cf diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index bad303a..a6a6f8c 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -37,7 +37,8 @@ public class DriveTrain extends Subsystem { private final CANTalon frontLeft, frontRight, rearLeft, rearRight; private final RobotDrive robotDrive; private final Encoder leftEncoder, rightEncoder; - private final DoubleSolenoid leftGearPiston, rightGearPiston; + private final DoubleSolenoid leftDriveTrainPiston, rightDriveTrainPiston; + private final DoubleSolenoid gearManipulatorPiston; private ADXRS450_Gyro imu; @@ -65,12 +66,19 @@ public class DriveTrain extends Subsystem { this.imu = new ADXRS450_Gyro(Constants.DriveTrain.GYRO_PORT); // TODO: Not sure if MODULE_NUMBER should be the same for both - leftGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE, + leftDriveTrainPiston = new DoubleSolenoid( + Constants.DriveTrain.PISTON_MODULE, Constants.DriveTrain.LEFT_GEAR_PISTON_FORWARD, Constants.DriveTrain.LEFT_GEAR_PISTON_REVERSE); - rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.PISTON_MODULE, + rightDriveTrainPiston = new DoubleSolenoid( + Constants.DriveTrain.PISTON_MODULE, Constants.DriveTrain.RIGHT_GEAR_PISTON_FORWARD, Constants.DriveTrain.RIGHT_GEAR_PISTON_REVERSE); + + gearManipulatorPiston = new DoubleSolenoid( + Constants.DriveTrain.PISTON_MODULE, + Constants.DriveTrain.GEAR_MANIPULATOR_PISTON_FORWARD, + Constants.DriveTrain.GEAR_MANIPULATOR_PISTON_REVERSE); } public static DriveTrain getDriveTrain() { @@ -158,38 +166,50 @@ public class DriveTrain extends Subsystem { * @return a value that is the current setpoint for the piston kReverse or * KForward */ - public Value getLeftGearPistonValue() { - return leftGearPiston.get(); + public Value getLeftDriveTrainPiston() { + return leftDriveTrainPiston.get(); } /* * @return a value that is the current setpoint for the piston kReverse or * KForward */ - public Value getRightGearPistonValue() { - return rightGearPiston.get(); + public Value getRightDriveTrainPiston() { + return rightDriveTrainPiston.get(); } /* * Changes the ball shift gear assembly to high */ public void setHighGear() { - changeGear(Constants.DriveTrain.HIGH_GEAR); + changeGear(Constants.DriveTrain.FORWARD_PISTON_VALUE); } /* * Changes the ball shift gear assembly to low */ public void setLowGear() { - changeGear(Constants.DriveTrain.LOW_GEAR); + changeGear(Constants.DriveTrain.REVERSE_PISTON_VALUE); } /* * Changes the gear to a DoubleSolenoid.Value */ private void changeGear(DoubleSolenoid.Value gear) { - leftGearPiston.set(gear); - rightGearPiston.set(gear); + leftDriveTrainPiston.set(gear); + rightDriveTrainPiston.set(gear); + } + + public Value getGearManipulatorPistonValue() { + return gearManipulatorPiston.get(); + } + + public void extendGearManipulatorPiston() { + gearManipulatorPiston.set(Constants.DriveTrain.FORWARD_PISTON_VALUE); + } + + public void retractGearManipulatorPiston() { + gearManipulatorPiston.set(Constants.DriveTrain.REVERSE_PISTON_VALUE); } @Override