competition fixes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinch.java
index 0e980a49e3b3bb02ed2db8a95d6f866d568f893f..39149abb14fba12c4c77e24d5aaf2d694da20bf6 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.Climber;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -23,6 +24,8 @@ import edu.wpi.first.wpilibj.command.Command;
  */
 
 public class RunWinch extends Command {
+  Climber climber = Robot.getClimber();
+
   private double time;
   private double motorVal;
 
@@ -34,30 +37,31 @@ public class RunWinch extends Command {
    * @param motorVal
    *          value range is from -1 to 1
    */
-  public RunWinch(double time, double motorVal) {
-    requires(Robot.getDriveTrain());
+  public RunWinch() {
+    requires(climber);
     this.time = time;
     this.motorVal = motorVal;
   }
 
   @Override
   protected void initialize() {
+    climber.setCANTalonsBrakeMode(climber.COAST_MODE);
   }
 
   @Override
   protected void execute() {
-    Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
-
+    climber.setMotorValues(climber.CLIMBER_SPEED);
   }
 
   @Override
   protected boolean isFinished() {
-    return timeSinceInitialized() >= time;
+    // return timeSinceInitialized() >= time;
+    return false;
   }
 
   @Override
   protected void end() {
-    Robot.getDriveTrain().stop();
+    climber.stop();
   }
 
   @Override