implement ToggleWinch command
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / RunWinchContinuous.java
CommitLineData
9738295a
SG
1package org.usfirst.frc.team3501.robot.commands.climber;
2
a04ce2ff 3import org.usfirst.frc.team3501.robot.Robot;
9dc69158 4import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
a04ce2ff 5
9738295a
SG
6import edu.wpi.first.wpilibj.command.Command;
7
8/**
d8ebba03
CZ
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
e2e9a7a7 11 *
2a9dabb1
CZ
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.
e2e9a7a7 14 *
d8ebba03 15 * post-condition: Drive train motors set to a specified speed.
e2e9a7a7 16 *
9738295a
SG
17 * @author shivanighanta
18 *
19 */
20public class RunWinchContinuous extends Command {
9dc69158
CZ
21 DriveTrain driveTrain = Robot.getDriveTrain();
22 private double climbingSpeed;
9738295a 23
ad877a7e 24 /**
411129cd
SG
25 * See JavaDoc comment in class for details
26 *
ad877a7e 27 * @param motorVal
411129cd 28 * value range is from -1 to 1
ad877a7e 29 */
cef1f36d 30 public RunWinchContinuous() {
9dc69158
CZ
31 requires(driveTrain);
32 climbingSpeed = driveTrain.CLIMBER_SPEED;
9738295a
SG
33 }
34
35 @Override
36 protected void initialize() {
37 }
38
39 @Override
40 protected void execute() {
9dc69158 41 Robot.getDriveTrain().setMotorValues(climbingSpeed, climbingSpeed);
9738295a
SG
42 }
43
44 @Override
45 protected boolean isFinished() {
3e515b75 46 return false;
9738295a
SG
47 }
48
49 @Override
50 protected void end() {
411129cd 51
9738295a
SG
52 }
53
54 @Override
55 protected void interrupted() {
a04ce2ff 56 end();
9738295a
SG
57 }
58}