Add pre-conditions and post-conditions to comments
[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
5 import edu.wpi.first.wpilibj.command.Command;
6
7 /**
8 * This command will run the winch motor continuously until the button
9 * triggering it is released.
10 *
11 * pre-condition: This command must be run by a button in OI. The robot must be
12 * attached to the rope.
13 *
14 * post-condition: Winch motor set to a specified speed.
15 *
16 * @param motorVal
17 * value range is from -1 to 1
18 *
19 * @author shivanighanta
20 *
21 */
22 public class RunWinchContinuous extends Command {
23 private double motorVal;
24
25 public RunWinchContinuous(double motorVal) {
26 this.motorVal = motorVal;
27 }
28
29 @Override
30 protected void initialize() {
31 Robot.getClimber().setMotorValue(motorVal);
32
33 }
34
35 @Override
36 protected void execute() {
37
38 }
39
40 @Override
41 protected boolean isFinished() {
42 return !Robot.getOI().toggleWinch.get();
43 }
44
45 @Override
46 protected void end() {
47 Robot.getClimber().stop();
48 }
49
50 @Override
51 protected void interrupted() {
52 end();
53 }
54 }