5631290c2b57306098bccc7a0986977206ee059d
[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
5 import edu.wpi.first.wpilibj.command.Command;
6
7 /**
8 * <<<<<<< 1b45bc927675060d057730fc7c7083fb9d813f66 This command runs the winch
9 * motor continuously at a specified speed until the button triggering it is
10 * released. This command also makes the drive train motors run because the
11 * winch is controlled by the drive train. ======= This command will run the
12 * winch motor continuously until the button triggering it is released. This
13 * command also runs the drive train. >>>>>>> Delete StopWinch and Climber
14 * subsystem, edit javadoc comments
15 *
16 * pre-condition: This command must be run by a button in OI. The robot must be
17 * attached to the rope.
18 *
19 * post-condition: Winch motor set to a specified speed.
20 *
21 * @author shivanighanta
22 *
23 */
24 public class RunWinchContinuous extends Command {
25 private double motorVal;
26
27 /**
28 * See JavaDoc comment in class for details
29 *
30 * @param motorVal
31 * value range is from -1 to 1
32 */
33 public RunWinchContinuous(double motorVal) {
34 requires(Robot.getDriveTrain());
35 this.motorVal = motorVal;
36 }
37
38 @Override
39 protected void initialize() {
40 Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
41 }
42
43 @Override
44 protected void execute() {
45
46 }
47
48 @Override
49 protected boolean isFinished() {
50 return false;
51 }
52
53 @Override
54 protected void end() {
55
56 }
57
58 @Override
59 protected void interrupted() {
60 end();
61 }
62 }