1 package org
.usfirst
.frc
.team3501
.robot
.commands
.climber
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
4 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Climber
;
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. This command also makes the drive train
11 * motors run because the winch is controlled by the drive train.
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
26 public class RunWinch
extends Command
{
27 Climber climber
= Robot
.getClimber();
30 private double motorVal
;
33 * See JavaDoc comment in class for details
36 * time in seconds to run the winch
38 * value range is from -1 to 1
43 this.motorVal
= motorVal
;
47 protected void initialize() {
48 climber
.setCANTalonsBrakeMode(climber
.COAST_MODE
);
52 protected void execute() {
53 climber
.setMotorValues(climber
.CLIMBER_SPEED
);
57 protected boolean isFinished() {
58 // return timeSinceInitialized() >= time;
63 protected void end() {
68 protected void interrupted() {