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
.DriveTrain
;
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 * robot has completed the climb and when the button triggering it is pressed.
11 * This command also makes the drive train motors run because the winch is
12 * controlled by the drive train.
14 * pre-condition: This command is run by a button in OI. The robot must have
17 * post-condition: Winch motor set to a specified speed for a specified time.
20 * value range is from -1 to 1
23 * @author shivanighanta
26 public class MaintainClimbedPosition
extends Command
{
30 * See JavaDoc comment in class for details
33 * time in seconds to run the winch
35 public MaintainClimbedPosition(double time
) {
36 requires(Robot
.getDriveTrain());
41 protected void initialize() {
45 protected void execute() {
46 Robot
.getDriveTrain().setMotorValues(DriveTrain
.MAINTAIN_CLIMBED_POSITION
,
47 DriveTrain
.MAINTAIN_CLIMBED_POSITION
);
52 protected boolean isFinished() {
53 return timeSinceInitialized() >= time
;
57 protected void end() {
58 Robot
.getDriveTrain().stop();
62 protected void interrupted() {