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 | /** | |
9d7d6676 | 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 | |
e2e9a7a7 SG |
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 | * | |
9738295a SG |
21 | * @author shivanighanta |
22 | * | |
23 | */ | |
24 | public class RunWinchContinuous extends Command { | |
25 | private double motorVal; | |
26 | ||
ad877a7e | 27 | /** |
411129cd SG |
28 | * See JavaDoc comment in class for details |
29 | * | |
ad877a7e | 30 | * @param motorVal |
411129cd | 31 | * value range is from -1 to 1 |
ad877a7e | 32 | */ |
9738295a | 33 | public RunWinchContinuous(double motorVal) { |
411129cd | 34 | requires(Robot.getDriveTrain()); |
9738295a SG |
35 | this.motorVal = motorVal; |
36 | } | |
37 | ||
38 | @Override | |
39 | protected void initialize() { | |
411129cd | 40 | Robot.getDriveTrain().setMotorValues(motorVal, motorVal); |
9738295a SG |
41 | } |
42 | ||
43 | @Override | |
44 | protected void execute() { | |
45 | ||
46 | } | |
47 | ||
48 | @Override | |
49 | protected boolean isFinished() { | |
3e515b75 | 50 | return false; |
9738295a SG |
51 | } |
52 | ||
53 | @Override | |
54 | protected void end() { | |
411129cd | 55 | |
9738295a SG |
56 | } |
57 | ||
58 | @Override | |
59 | protected void interrupted() { | |
a04ce2ff | 60 | end(); |
9738295a SG |
61 | } |
62 | } |