1 package org
.usfirst
.frc
.team3501
.robot
.commands
.climber
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.Timer
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
9 * This command runs the winch at a specified speed and time in seconds when the
10 * button triggering it is pressed.
12 * pre-condition: This command is run by a button in OI. The robot must be
13 * attached to the rope.
15 * post-condition: Winch motor set to a specified speed for a specified time.
18 * value range is from -1 to 1
21 * @author shivanighanta
24 public class RunWinch
extends Command
{
27 private double motorVal
;
29 public RunWinch(double time
, double motorVal
) {
30 requires(Robot
.getClimber());
32 this.motorVal
= motorVal
;
36 protected void initialize() {
38 Robot
.getClimber().setMotorValue(motorVal
);
42 protected void execute() {
47 protected boolean isFinished() {
48 return timer
.get() >= time
;
52 protected void end() {
53 Robot
.getClimber().stop();
57 protected void interrupted() {