Saved
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
index 65277997b70fd20ccad3d85fbe60b2b5a8eb23c1..664b201643b113a16b7944a1223d541b3bcb5ee3 100644 (file)
@@ -1,6 +1,8 @@
 package org.usfirst.frc.team3501.robot.commands.climber;
 
+import org.usfirst.frc.team3501.robot.OI;
 import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.subsystems.Climber;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -17,6 +19,8 @@ import edu.wpi.first.wpilibj.command.Command;
  *
  */
 public class RunWinchContinuous extends Command {
+  Climber climber = Robot.getClimber();
+  private double climbingSpeed;
 
   /**
    * See JavaDoc comment in class for details
@@ -25,19 +29,18 @@ public class RunWinchContinuous extends Command {
    *          value range is from -1 to 1
    */
   public RunWinchContinuous() {
-    requires(Robot.getDriveTrain());
+    requires(climber);
+    climbingSpeed = climber.CLIMBER_SPEED;
   }
 
   @Override
   protected void initialize() {
-    Robot.getDriveTrain().setMotorValues(
-        Robot.getDriveTrain().getClimbingSpeed(),
-        Robot.getDriveTrain().getClimbingSpeed());
   }
 
   @Override
   protected void execute() {
-
+    double thrust = OI.xboxController.getY();
+    climber.setMotorValues(-thrust);
   }
 
   @Override
@@ -47,7 +50,7 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected void end() {
-
+    climber.stop();
   }
 
   @Override