X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fcommands%2Fclimber%2FRunWinchContinuous.java;h=664b201643b113a16b7944a1223d541b3bcb5ee3;hb=8275a069e1891bd27156dcd947a897519c42a3a3;hp=1cd5381786659f8f9e4c00b6f640efac174ea00a;hpb=c3e1f46b7fd9b6abfe9f811fb0a15b663cd36ee6;p=3501%2F2017steamworks diff --git a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java index 1cd5381..664b201 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/climber/RunWinchContinuous.java @@ -1,27 +1,26 @@ 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; /** - * This command will run the winch motor continuously until the button - * triggering it is released. This command also makes the drive train motors run - * because the winch is controlled by the drive train. + * This command runs the drive train motors (which runs the winch) continuously + * at a specified speed until the button triggering it is released * - * pre-condition: This command must be run by a button in OI. The robot must be - * attached to the rope. + * pre-condition: This command must be run by a button in OI with + * button.whileHeld(...). The robot must be attached to the rope. * - * post-condition: Winch motor set to a specified speed. - * - * @param motorVal - * value range is from -1 to 1 + * post-condition: Drive train motors set to a specified speed. * * @author shivanighanta * */ public class RunWinchContinuous extends Command { - private double motorVal; + Climber climber = Robot.getClimber(); + private double climbingSpeed; /** * See JavaDoc comment in class for details @@ -29,20 +28,19 @@ public class RunWinchContinuous extends Command { * @param motorVal * value range is from -1 to 1 */ - public RunWinchContinuous(double motorVal) { - requires(Robot.getDriveTrain()); - this.motorVal = motorVal; + public RunWinchContinuous() { + requires(climber); + climbingSpeed = climber.CLIMBER_SPEED; } @Override protected void initialize() { - Robot.getDriveTrain().setMotorValues(motorVal, motorVal); - } @Override protected void execute() { - + double thrust = OI.xboxController.getY(); + climber.setMotorValues(-thrust); } @Override @@ -52,7 +50,7 @@ public class RunWinchContinuous extends Command { @Override protected void end() { - + climber.stop(); } @Override