competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinch.java
index c790a6cf70e7f39670d2dd382991562f8fea2798..5a76b5c182b377c6892b64c75572ca0857fa44ec 100644 (file)
@@ -1,8 +1,8 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
 import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Climber;
 
-import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -15,12 +15,17 @@ import edu.wpi.first.wpilibj.command.Command;
  *
  * post-condition: Winch motor set to a specified speed for a specified time.
  *
+ * @param motorVal
+ *          value range is from -1 to 1
+ * @param time
+ *          in seconds
  * @author shivanighanta
  *
  */
 
 public class RunWinch extends Command {
-  Timer timer;
+  Climber climber = Robot.getClimber();
+
   private double time;
   private double motorVal;
 
@@ -33,43 +38,28 @@ public class RunWinch extends Command {
    *          value range is from -1 to 1
    */
   public RunWinch(double time, double motorVal) {
-<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3
-    requires(Robot.getDriveTrain());
-=======
-    requires(Robot.getClimber());
->>>>>>> Implement RunWinch
+    requires(climber);
     this.time = time;
     this.motorVal = motorVal;
   }
 
   @Override
   protected void initialize() {
-    timer.start();
-<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3
-=======
-    Robot.getClimber().setMotorValues(motorVal, motorVal);
->>>>>>> Implement RunWinch
   }
 
   @Override
   protected void execute() {
-    Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
-
+    climber.setMotorValues(motorVal);
   }
 
   @Override
   protected boolean isFinished() {
-    return timer.get() >= time;
+    return timeSinceInitialized() >= time;
   }
 
   @Override
   protected void end() {
-<<<<<<< a5147d5928f01620d8e10f2e9cdea079526d2db3
-    Robot.getDriveTrain().stop();
-
-=======
-    Robot.getClimber().stop();
->>>>>>> Implement RunWinch
+    climber.stop();
   }
 
   @Override