Fix code changes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / climber / MaintainClimbedPosition.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 winch at a specified speed when the robot has completed
10 * the climb and when the button triggering it is pressed. This command also
11 * makes the drive train motors run because the winch is controlled by the drive
12 * train.
13 *
14 * pre-condition: This command is run by a button in OI. The robot must have
15 * completed climbing.
16 *
17 * post-condition: Winch motor set to a specified speed.
18 *
19 * @param motorVal
20 * value range is from -1 to 1
21 *
22 * @author shivanighanta
23 *
24 */
25 public class MaintainClimbedPosition extends Command {
26
27 /**
28 * See JavaDoc comment in class for details
29 *
30 * @param time
31 * time in seconds to run the winch
32 */
33 public MaintainClimbedPosition() {
34 requires(Robot.getDriveTrain());
35 }
36
37 @Override
38 protected void initialize() {
39 }
40
41 @Override
42 protected void execute() {
43 Robot.getDriveTrain().setMotorValues(DriveTrain.MAINTAIN_CLIMBED_POSITION,
44 DriveTrain.MAINTAIN_CLIMBED_POSITION);
45 }
46
47 @Override
48 protected boolean isFinished() {
49 return false;
50 }
51
52 @Override
53 protected void end() {
54 Robot.getDriveTrain().stop();
55 }
56
57 @Override
58 protected void interrupted() {
59 end();
60 }
61 }