Add command group for ToggleWinch
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
index 32ec06253e7be998195641cdaf87c114c52f935d..05fb72dbbbf46fc6c1bad4c9df8adbddc679354b 100644 (file)
@@ -1,7 +1,6 @@
 package org.usfirst.frc.team3501.robot;
 
-import org.usfirst.frc.team3501.robot.commands.climber.MaintainClimbedPosition;
-import org.usfirst.frc.team3501.robot.commands.climber.RunWinchContinuous;
+import org.usfirst.frc.team3501.robot.commandgroups.ToggleWinch;
 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;
@@ -18,7 +17,6 @@ public class OI {
   public static Joystick leftJoystick;
   public static Joystick rightJoystick;
   public static Button toggleWinch;
-  private boolean isClimbing = false;
 
   public static Button runIndexWheel;
   public static Button reverseIndexWheel;
@@ -59,13 +57,13 @@ public class OI {
 
     toggleWinch = new JoystickButton(leftJoystick,
         Constants.OI.TOGGLE_WINCH_PORT);
-    if (!isClimbing) {
-      toggleWinch.whenPressed(new RunWinchContinuous());
-      isClimbing = true;
-    } else {
-      toggleWinch.whenPressed(new MaintainClimbedPosition());
-      isClimbing = false;
-    }
+    /*
+     * if (!Robot.getDriveTrain().isClimbing()) { toggleWinch.whenPressed(new
+     * RunWinchContinuous()); Robot.getDriveTrain().setClimbing(true); } else {
+     * toggleWinch.whenPressed(new MaintainClimbedPosition());
+     * Robot.getDriveTrain().setClimbing(false); }
+     */
+    toggleWinch.whenPressed(new ToggleWinch());
   }
 
   public static OI getOI() {