implement ToggleWinch command
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
index e20121024a0528b7d3a8c0637f96bc154f4a39a2..210199d86e2cb3dc178fb5d289f0446e4147368f 100644 (file)
@@ -1,6 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
 import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -17,7 +18,8 @@ import edu.wpi.first.wpilibj.command.Command;
  *
  */
 public class RunWinchContinuous extends Command {
-  private double motorVal;
+  DriveTrain driveTrain = Robot.getDriveTrain();
+  private double climbingSpeed;
 
   /**
    * See JavaDoc comment in class for details
@@ -25,19 +27,18 @@ public class RunWinchContinuous extends Command {
    * @param motorVal
    *          value range is from -1 to 1
    */
-  public RunWinchContinuous(double motorVal) {
-    requires(Robot.getDriveTrain());
-    this.motorVal = motorVal;
+  public RunWinchContinuous() {
+    requires(driveTrain);
+    climbingSpeed = driveTrain.CLIMBER_SPEED;
   }
 
   @Override
   protected void initialize() {
-    Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
   }
 
   @Override
   protected void execute() {
-
+    Robot.getDriveTrain().setMotorValues(climbingSpeed, climbingSpeed);
   }
 
   @Override