f1fae231c7fd4370cb4ff2901f63ab63b324ded2
[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 <<<<<<< HEAD
22 DriveTrain driveTrain = Robot.getDriveTrain();
23 private double climbingSpeed;
24 =======
25 >>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
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() {
34 <<<<<<< HEAD
35 requires(driveTrain);
36 climbingSpeed = driveTrain.CLIMBER_SPEED;
37 =======
38 requires(Robot.getDriveTrain());
39 >>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
40 }
41
42 @Override
43 protected void initialize() {
44 <<<<<<< HEAD
45 =======
46 Robot.getDriveTrain().setMotorValues(
47 Robot.getDriveTrain().getClimbingSpeed(),
48 Robot.getDriveTrain().getClimbingSpeed());
49 >>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
50 }
51
52 @Override
53 protected void execute() {
54 Robot.getDriveTrain().setMotorValues(climbingSpeed, climbingSpeed);
55 }
56
57 @Override
58 protected boolean isFinished() {
59 return false;
60 }
61
62 @Override
63 protected void end() {
64
65 }
66
67 @Override
68 protected void interrupted() {
69 end();
70 }
71 }