Remove compressor because solenoids automatically call it
authorHarel Dor <hareldor@gmail.com>
Tue, 23 Feb 2016 02:34:17 +0000 (18:34 -0800)
committerHarel Dor <hareldor@gmail.com>
Tue, 23 Feb 2016 02:34:17 +0000 (18:34 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/Robot.java
src/org/usfirst/frc/team3501/robot/commands/driving/ToggleCompressor.java [deleted file]
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java

index 1a1a20bb5c2fbd0a45460a257aff2d2ef9b4594c..114dc509fc60eec6e0a3fc79f7f99712562022e1 100644 (file)
@@ -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;
 
index 8de027b73502223533f8b786c11f1804909ca53a..cb7e12d9b3120c094e24f39869be0d6deea94cf6 100644 (file)
@@ -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());
index 14f86db3be6c821014c7dc88c6b8eeaf2cb861c0..5bb61f143bc139c14b81221919ef90893b4c0382 100644 (file)
@@ -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 (file)
index f78acb2..0000000
+++ /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();
-  }
-}
index 064c1894404d28a19977f6858f12133e7ba6efdd..dc631394f8dc1e315e553af3c0f5fd5b6a40c63c 100644 (file)
@@ -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();
-  }
-
 }