Finish implementing MaintainClimbedPosition
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinch.java
index e7e71f30d8a48a484c25628eb917aa3e4fb86f92..7858384dac649f30555d40761e6fa52b6e09ebd5 100644 (file)
@@ -2,7 +2,6 @@ package org.usfirst.frc.team3501.robot.commands.climber;
 
 import org.usfirst.frc.team3501.robot.Robot;
 
-import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
 
 /**
@@ -15,12 +14,15 @@ 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;
   private double time;
   private double motorVal;
 
@@ -30,7 +32,7 @@ public class RunWinch extends Command {
    * @param time
    *          time in seconds to run the winch
    * @param motorVal
-   *          value range is from -1 to 1
+   *          value range is frosm -1 to 1
    */
   public RunWinch(double time, double motorVal) {
     requires(Robot.getDriveTrain());
@@ -40,7 +42,6 @@ public class RunWinch extends Command {
 
   @Override
   protected void initialize() {
-    timer.start();
   }
 
   @Override
@@ -51,13 +52,12 @@ public class RunWinch extends Command {
 
   @Override
   protected boolean isFinished() {
-    return timer.get() >= time;
+    return timeSinceInitialized() >= time;
   }
 
   @Override
   protected void end() {
     Robot.getDriveTrain().stop();
-
   }
 
   @Override