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