210199d86e2cb3dc178fb5d289f0446e4147368f
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
1 package org.usfirst.frc.team3501.robot.commands.climber;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
5
6 import edu.wpi.first.wpilibj.command.Command;
7
8 /**
9 * This command runs the drive train motors (which runs the winch) continuously
10 * at a specified speed until the button triggering it is released
11 *
12 * pre-condition: This command must be run by a button in OI with
13 * button.whileHeld(...). The robot must be attached to the rope.
14 *
15 * post-condition: Drive train motors set to a specified speed.
16 *
17 * @author shivanighanta
18 *
19 */
20 public class RunWinchContinuous extends Command {
21 DriveTrain driveTrain = Robot.getDriveTrain();
22 private double climbingSpeed;
23
24 /**
25 * See JavaDoc comment in class for details
26 *
27 * @param motorVal
28 * value range is from -1 to 1
29 */
30 public RunWinchContinuous() {
31 requires(driveTrain);
32 climbingSpeed = driveTrain.CLIMBER_SPEED;
33 }
34
35 @Override
36 protected void initialize() {
37 }
38
39 @Override
40 protected void execute() {
41 Robot.getDriveTrain().setMotorValues(climbingSpeed, climbingSpeed);
42 }
43
44 @Override
45 protected boolean isFinished() {
46 return false;
47 }
48
49 @Override
50 protected void end() {
51
52 }
53
54 @Override
55 protected void interrupted() {
56 end();
57 }
58 }