Fix stupid stuff
authorKevin Zhang <icestormf1@gmail.com>
Sun, 21 Feb 2016 22:48:25 +0000 (14:48 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Tue, 23 Feb 2016 00:22:21 +0000 (16:22 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/commands/shooter/ChangeShooterSpeed.java
src/org/usfirst/frc/team3501/robot/commands/shooter/ExtendPunch.java
src/org/usfirst/frc/team3501/robot/commands/shooter/Shoot.java
src/org/usfirst/frc/team3501/robot/commands/shooter/Test1.java [deleted file]
src/org/usfirst/frc/team3501/robot/commands/shooter/Test2.java [deleted file]
src/org/usfirst/frc/team3501/robot/commands/shooter/Test3.java [deleted file]
src/org/usfirst/frc/team3501/robot/commands/shooter/runShooter.java

index 4374e3720bfe775845dca32e0f1598256adf3b39..518196fee403048c790e76c7b24371922e82ebac 100644 (file)
@@ -126,6 +126,8 @@ public class Constants {
     public static enum State {
       RUNNING, STOPPED;
     }
+
+    public static double TESTING_SHOOTER_SPEED = 0.5;
   }
 
   public static class IntakeArm {
index cc5dcc5d467bec867243f0722612c647ec0f8c43..0157b45b965df8db82fbc33005cf456d1dd0ca03 100644 (file)
@@ -1,10 +1,9 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commands.shooter.ChangeShooterSpeed;
 import org.usfirst.frc.team3501.robot.commands.shooter.PrintData;
 import org.usfirst.frc.team3501.robot.commands.shooter.RecordData;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test1;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test2;
-import org.usfirst.frc.team3501.robot.commands.shooter.Test3;
+import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
 
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
@@ -96,15 +95,15 @@ public class OI {
 
     shoot = new JoystickButton(leftJoystick,
         Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
-    shoot.whenPressed(new Test1());
+    shoot.whenPressed(new Shoot());
 
     incrementSpeed = new JoystickButton(leftJoystick,
         Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
-    incrementSpeed.whenPressed(new Test2());
+    incrementSpeed.whenPressed(new ChangeShooterSpeed(0.1));
 
     decrementSpeed = new JoystickButton(leftJoystick,
         Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
-    decrementSpeed.whenPressed(new Test3());
+    decrementSpeed.whenPressed(new ChangeShooterSpeed(-0.1));
 
     printData = new JoystickButton(leftJoystick,
         Constants.OI.SPIN2_PORT);
index 186f79720377a9ca5c9ab6248ef0dc8a67e93453..c8002f71c46691c30acde12965fd53c9c5fcd591 100644 (file)
@@ -1,5 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands.shooter;
 
+import org.usfirst.frc.team3501.robot.Constants;
 import org.usfirst.frc.team3501.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
@@ -14,6 +15,7 @@ public class ChangeShooterSpeed extends Command {
   @Override
   protected void initialize() {
     Robot.shooter.changeSpeed(change);
+    Constants.Shooter.TESTING_SHOOTER_SPEED += change;
   }
 
   @Override
index a3cb8138c449f153fb747e2caed0298a1ec4d433..b4bf53d9a69dda8be340db602b1965d2e58a32ab 100644 (file)
@@ -8,6 +8,7 @@ public class ExtendPunch extends Command {
 
   @Override
   protected void initialize() {
+    requires(Robot.shooter);
     Robot.shooter.extendPunch();
   }
 
index 31fb261e576f0a9748769a1bfa7dd3d5f94b1aee..0a0e8bf022692996c9930a3ed75c41b15e005f5c 100755 (executable)
@@ -7,10 +7,9 @@ import edu.wpi.first.wpilibj.command.WaitCommand;
 
 public class Shoot extends CommandGroup {
 
-  public boolean usePhotogate;
+  public boolean usePhotogate = false;
 
   public Shoot() {
-    addSequential(new WaitCommand(3.0));
     addSequential(new runShooter());
     addSequential(new WaitCommand(3.0));
     if (Robot.shooter.usePhotogate()) {
diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/Test1.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/Test1.java
deleted file mode 100644 (file)
index edb1e0a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test1 extends CommandGroup {
-
-  public Test1() {
-    addSequential(new Shoot());
-  }
-}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/Test2.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/Test2.java
deleted file mode 100644 (file)
index 09d1856..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test2 extends CommandGroup {
-
-  public Test2() {
-    addSequential(new ChangeShooterSpeed(0.05));
-  }
-}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/Test3.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/Test3.java
deleted file mode 100644 (file)
index 959cb2d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.usfirst.frc.team3501.robot.commands.shooter;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- *
- */
-public class Test3 extends CommandGroup {
-
-  public Test3() {
-    addSequential(new ChangeShooterSpeed(-0.05));
-  }
-}
index b4e80578c247d89c04348e81354143454d79e831..9e7fca36db4d017846aee43ec0da4b1a5acd4ffd 100644 (file)
@@ -1,5 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands.shooter;
 
+import org.usfirst.frc.team3501.robot.Constants;
 import org.usfirst.frc.team3501.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
@@ -10,13 +11,13 @@ import edu.wpi.first.wpilibj.command.Command;
 public class runShooter extends Command {
 
   public runShooter() {
-
+    requires(Robot.shooter);
   }
 
   // default shooter speed is used to shoot when in front of the batter
   @Override
   protected void initialize() {
-    Robot.shooter.setSpeed(0.5);
+    Robot.shooter.setSpeed(Constants.Shooter.TESTING_SHOOTER_SPEED);
   }
 
   @Override