Delete timer from MaintainClimbedPosition
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinch.java
index f02ed62510aabf2a731addd2a04f675a009627f8..0e980a49e3b3bb02ed2db8a95d6f866d568f893f 100644 (file)
@@ -2,12 +2,12 @@ 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;
 
 /**
  * This command runs the winch at a specified speed and time in seconds when the
- * button triggering it is pressed. This command also runs the drive train.
+ * button triggering it is pressed. This command also makes the drive train
+ * motors run because the winch is controlled by the drive train.
  *
  * pre-condition: This command is run by a button in OI. The robot must be
  * attached to the rope.
@@ -23,7 +23,6 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 
 public class RunWinch extends Command {
-  Timer timer;
   private double time;
   private double motorVal;
 
@@ -43,7 +42,6 @@ public class RunWinch extends Command {
 
   @Override
   protected void initialize() {
-    timer.start();
   }
 
   @Override
@@ -54,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