From cc64f0189c06a995e740d978a837612d15a7bbcc Mon Sep 17 00:00:00 2001 From: Harel Dor Date: Mon, 22 Feb 2016 18:34:17 -0800 Subject: [PATCH] Remove compressor because solenoids automatically call it --- .../usfirst/frc/team3501/robot/Constants.java | 1 - src/org/usfirst/frc/team3501/robot/OI.java | 6 --- src/org/usfirst/frc/team3501/robot/Robot.java | 1 - .../commands/driving/ToggleCompressor.java | 38 ------------------- .../team3501/robot/subsystems/DriveTrain.java | 19 ---------- 5 files changed, 65 deletions(-) delete mode 100644 src/org/usfirst/frc/team3501/robot/commands/driving/ToggleCompressor.java diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 1a1a20bb..114dc509 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -68,7 +68,6 @@ public class Constants { public static final int MODULE_A_ID = 9, MODULE_B_ID = 10; public static final int LEFT_FORWARD = 5, LEFT_REVERSE = 1, RIGHT_FORWARD = 4, RIGHT_REVERSE = 0; - public static final int COMPRESSOR_ID = 9; public static double time = 0; diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index 8de027b7..cb7e12d9 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -1,7 +1,6 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.commands.driving.ChangeGear; -import org.usfirst.frc.team3501.robot.commands.driving.ToggleCompressor; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; @@ -35,7 +34,6 @@ public class OI { public static Button intakeBoulder; public static Button shootBoulder; public static Button toggleGear; - public static Button toggleCompressor; // button to change robot to the scaling mode public static DigitalButton toggleScaling; @@ -48,10 +46,6 @@ public class OI { Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); toggleGear.toggleWhenPressed(new ChangeGear()); - toggleCompressor = new JoystickButton(rightJoystick, - Constants.OI.TOGGLE_COMPRESSOR_PORT); - toggleCompressor.whenPressed(new ToggleCompressor()); - // passPortcullis = new DigitalButton( // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT)); // passPortcullis.whenPressed(new PassPortcullis()); diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 14f86db3..5bb61f14 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -121,7 +121,6 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { Robot.driveTrain.setLowGear(); - Robot.driveTrain.startCompressor(); } @Override diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleCompressor.java b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleCompressor.java deleted file mode 100644 index f78acb25..00000000 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleCompressor.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.usfirst.frc.team3501.robot.commands.driving; - -import org.usfirst.frc.team3501.robot.Robot; - -import edu.wpi.first.wpilibj.command.Command; - -/** - * - */ -public class ToggleCompressor extends Command { - - public ToggleCompressor() { - - } - - @Override - protected void initialize() { - Robot.driveTrain.toggleCompressor(); - } - - @Override - protected void execute() { - } - - @Override - protected boolean isFinished() { - return true; - } - - @Override - protected void end() { - } - - @Override - protected void interrupted() { - end(); - } -} diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index 064c1894..dc631394 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -7,7 +7,6 @@ import org.usfirst.frc.team3501.robot.sensors.GyroLib; import org.usfirst.frc.team3501.robot.sensors.Lidar; import edu.wpi.first.wpilibj.CANTalon; -import edu.wpi.first.wpilibj.Compressor; import edu.wpi.first.wpilibj.CounterBase.EncodingType; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; @@ -30,7 +29,6 @@ public class DriveTrain extends PIDSubsystem { private GyroLib gyro; private DoubleSolenoid leftGearPiston, rightGearPiston; - private Compressor compressor; // Drivetrain specific constants that relate to the inches per pulse value for // the encoders @@ -69,8 +67,6 @@ public class DriveTrain extends PIDSubsystem { rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.MODULE_B_ID, Constants.DriveTrain.RIGHT_FORWARD, Constants.DriveTrain.RIGHT_REVERSE); - compressor = new Compressor(Constants.DriveTrain.COMPRESSOR_ID); - Constants.DriveTrain.inverted = false; } @@ -369,19 +365,4 @@ public class DriveTrain extends PIDSubsystem { rightGearPiston.set(gear); } - public void startCompressor() { - compressor.start(); - } - - public void stopCompressor() { - compressor.stop(); - } - - public void toggleCompressor() { - if (compressor.enabled()) - compressor.stop(); - else - compressor.start(); - } - } -- 2.30.2