Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
index ee075f29f6ac7b5bda8c1d5a2d23b619d46b16c6..65277997b70fd20ccad3d85fbe60b2b5a8eb23c1 100644 (file)
@@ -1,22 +1,38 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
- * Runs the winch continuously at a given motor value
+ * This command runs the drive train motors (which runs the winch) continuously
+ * at a specified speed until the button triggering it is released
+ *
+ * pre-condition: This command must be run by a button in OI with
+ * button.whileHeld(...). The robot must be attached to the rope.
+ *
+ * post-condition: Drive train motors set to a specified speed.
  *
  * @author shivanighanta
  *
  */
 public class RunWinchContinuous extends Command {
-  private double motorVal;
 
-  public RunWinchContinuous(double motorVal) {
-    this.motorVal = motorVal;
+  /**
+   * See JavaDoc comment in class for details
+   *
+   * @param motorVal
+   *          value range is from -1 to 1
+   */
+  public RunWinchContinuous() {
+    requires(Robot.getDriveTrain());
   }
 
   @Override
   protected void initialize() {
+    Robot.getDriveTrain().setMotorValues(
+        Robot.getDriveTrain().getClimbingSpeed(),
+        Robot.getDriveTrain().getClimbingSpeed());
   }
 
   @Override
@@ -36,5 +52,6 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected void interrupted() {
+    end();
   }
 }