1 package org
.usfirst
.frc
.team3501
.robot
.commands
.climber
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import com
.sun
.glass
.ui
.Timer
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * This command runs the winch at a specified speed and time in seconds when the
11 * button triggering it is pressed.
13 * pre-condition: This command is run by a button in OI. The robot must be
14 * attached to the rope.
16 * post-condition: Winch motor set to a specified speed for a specified time.
19 * value range is from -1 to 1
22 * @author shivanighanta
25 public class RunWinch
extends Command
{
28 private double motorVal
;
30 public RunWinch(double time
, double motorVal
) {
31 requires(Robot
.getClimber());
33 this.motorVal
= motorVal
;
37 protected void initialize() {
39 Robot
.getClimber().setMotorValue(motorVal
);
43 protected void execute() {
48 protected boolean isFinished() {
49 return timer
.get() >= time
;
53 protected void end() {
54 Robot
.getClimber().stop();
58 protected void interrupted() {