Add pre-conditions and post-conditions to comments
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
index 05fd63ae1c39b7158c2a1dc5ab3396801f192ba9..bb2a74e8398aeefc7a2a104a01822af6197b1967 100644 (file)
@@ -5,7 +5,16 @@ 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 will run the winch motor continuously until the button
+ * triggering it is released.
+ *
+ * pre-condition: This command must be run by a button in OI. The robot must be
+ * attached to the rope.
+ *
+ * post-condition: Winch motor set to a specified speed.
+ *
+ * @param motorVal
+ *          value range is from -1 to 1
  *
  * @author shivanighanta
  *
@@ -14,12 +23,13 @@ public class RunWinchContinuous extends Command {
   private double motorVal;
 
   public RunWinchContinuous(double motorVal) {
-    requires(Robot.getClimber());
     this.motorVal = motorVal;
   }
 
   @Override
   protected void initialize() {
+    Robot.getClimber().setMotorValue(motorVal);
+
   }
 
   @Override
@@ -29,7 +39,7 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected boolean isFinished() {
-    return false;
+    return !Robot.getOI().toggleWinch.get();
   }
 
   @Override