Fix merge conflicts
authorRohan Rodrigues <rohanrodrigues19@gmail.com>
Thu, 9 Mar 2017 01:07:49 +0000 (17:07 -0800)
committerRohan Rodrigues <rohanrodrigues19@gmail.com>
Thu, 9 Mar 2017 01:07:49 +0000 (17:07 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/commands/driving/ToggleDrivePiston.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/commands/shooter/RunIndexWheelContinuous.java

index 312e0c355a8b584dcda01b230f30bb15d121471a..26d36bb32c31e6f288f63532b7dd4a0759bfe0b0 100644 (file)
@@ -44,7 +44,6 @@ public class Constants {
 
     public static final int MODULE_NUMBER = 10, PISTON_FORWARD = 4,
         PISTON_REVERSE = 5;
-
     public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward;
     public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse;
   }
index e868ba3fae425d2eb6dcddb770250342e501de99..c2571ec7174649079463968e204cdae561a25990 100644 (file)
@@ -1,14 +1,8 @@
 package org.usfirst.frc.team3501.robot;
 
-<<<<<<< HEAD
 import org.usfirst.frc.team3501.robot.commands.driving.BrakeCANTalons;
 import org.usfirst.frc.team3501.robot.commands.driving.CoastCANTalons;
-=======
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
 
-import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
->>>>>>> Fix ChangeCameraView
 import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
 import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
 import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous;
@@ -17,21 +11,14 @@ import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
 import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous;
 import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous;
 import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
-<<<<<<< HEAD
 import org.usfirst.frc.team3501.robot.commands.shooter.ToggleIndexerPiston;
-=======
->>>>>>> Fix ChangeCameraView
 import org.usfirst.frc.team3501.robot.utils.ChangeCameraView;
 
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
 import edu.wpi.first.wpilibj.buttons.JoystickButton;
 
-<<<<<<< HEAD
 public class OI /* implements KeyListener */ {
-=======
-public class OI implements KeyListener {
->>>>>>> Fix ChangeCameraView
   private static OI oi;
   public static Joystick leftJoystick;
   public static Joystick rightJoystick;
@@ -111,6 +98,7 @@ public class OI implements KeyListener {
     coastCANTalons = new JoystickButton(rightJoystick,
         Constants.OI.COAST_CANTALONS_PORT);
     coastCANTalons.whenPressed(new CoastCANTalons());
+
   }
 
   public static OI getOI() {
@@ -119,7 +107,6 @@ public class OI implements KeyListener {
     return oi;
   }
 
-<<<<<<< HEAD
   /*
    * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
    * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
@@ -131,23 +118,4 @@ public class OI implements KeyListener {
    *
    * @Override public void keyTyped(KeyEvent e) { }
    */
-
-=======
-  @Override
-  public void keyTyped(KeyEvent e) {
-
-  }
-
-  @Override
-  public void keyPressed(KeyEvent e) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void keyReleased(KeyEvent e) {
-    // TODO Auto-generated method stub
-
-  }
->>>>>>> Fix ChangeCameraView
 }
diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleDrivePiston.java b/src/org/usfirst/frc/team3501/robot/commands/driving/ToggleDrivePiston.java
new file mode 100644 (file)
index 0000000..ad13cc0
--- /dev/null
@@ -0,0 +1,58 @@
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
+import edu.wpi.first.wpilibj.command.Command;
+
+public class ToggleDrivePiston extends Command {
+  private DriveTrain driveTrain = Robot.getDriveTrain();
+
+  /**
+   * See JavaDoc comment in class for details
+   *
+   * @param motorVal
+   *          value range from -1 to 1
+   */
+  public ToggleDrivePiston() {
+    requires(driveTrain);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+    if (DriveTrain.getDriveTrain()
+        .getLeftGearPistonValue() == Constants.DriveTrain.HIGH_GEAR) {
+      DriveTrain.getDriveTrain().setLowGear();
+    } else {
+      DriveTrain.getDriveTrain().setHighGear();
+    }
+
+    // check to make sure that both pistons are set to the same gear. Otherwise,
+    // the code must be changed
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+    end();
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return false;
+
+  }
+
+}
index 48f3546560c895c1bf4a8ae681503aa694f19d94..cf200ebfdd2afcce5d5fc1fa95ee476c25a05cc9 100644 (file)
@@ -1,7 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.shooter;
 
-import org.usfirst.frc.team3501.robot.Constants;
 import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.Constants;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;