Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
[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 {
ffb43c5c 21<<<<<<< HEAD
9dc69158
CZ
22 DriveTrain driveTrain = Robot.getDriveTrain();
23 private double climbingSpeed;
ffb43c5c
RR
24=======
25>>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
9738295a 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 */
cef1f36d 33 public RunWinchContinuous() {
ffb43c5c 34<<<<<<< HEAD
9dc69158
CZ
35 requires(driveTrain);
36 climbingSpeed = driveTrain.CLIMBER_SPEED;
ffb43c5c
RR
37=======
38 requires(Robot.getDriveTrain());
39>>>>>>> Add JoystickButton objects and constants for Drivetrain, Climer, Intake, and Shooter
9738295a
SG
40 }
41
42 @Override
43 protected void initialize() {
ffb43c5c
RR
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
9738295a
SG
50 }
51
52 @Override
53 protected void execute() {
9dc69158 54 Robot.getDriveTrain().setMotorValues(climbingSpeed, climbingSpeed);
9738295a
SG
55 }
56
57 @Override
58 protected boolean isFinished() {
3e515b75 59 return false;
9738295a
SG
60 }
61
62 @Override
63 protected void end() {
411129cd 64
9738295a
SG
65 }
66
67 @Override
68 protected void interrupted() {
a04ce2ff 69 end();
9738295a
SG
70 }
71}