competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinch.java
index bed5c8ca0bda9efa108d8840a12a0d64432bb885..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;
 
 /**
@@ -24,7 +24,8 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 
 public class RunWinch extends Command {
-  Timer timer;
+  Climber climber = Robot.getClimber();
+
   private double time;
   private double motorVal;
 
@@ -37,34 +38,28 @@ public class RunWinch extends Command {
    *          value range is from -1 to 1
    */
   public RunWinch(double time, double motorVal) {
-    requires(Robot.getDriveTrain());
+    requires(climber);
     this.time = time;
     this.motorVal = motorVal;
   }
 
   @Override
   protected void initialize() {
-    timer.start();
   }
 
   @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() {
-    Robot.getDriveTrain().stop();
-<<<<<<< 1b45bc927675060d057730fc7c7083fb9d813f66
-=======
-
->>>>>>> Delete StopWinch and Climber subsystem, edit javadoc comments
+    climber.stop();
   }
 
   @Override