Commit | Line | Data |
---|---|---|
fc01fb0f CZ |
1 | package org.usfirst.frc.team3501.robot.commands.driving; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Constants; | |
4 | import org.usfirst.frc.team3501.robot.Robot; | |
5 | import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; | |
6 | ||
7 | import edu.wpi.first.wpilibj.DoubleSolenoid.Value; | |
8 | import edu.wpi.first.wpilibj.command.Command; | |
9 | ||
10 | /** | |
11 | * | |
12 | */ | |
13 | public class ToggleGearManipulatorPiston extends Command { | |
14 | private DriveTrain driveTrain = Robot.getDriveTrain(); | |
15 | ||
16 | public ToggleGearManipulatorPiston() { | |
17 | } | |
18 | ||
19 | @Override | |
20 | protected void initialize() { | |
21 | Value gearPistonValue = driveTrain.getGearManipulatorPistonValue(); | |
22 | if (gearPistonValue == Constants.DriveTrain.REVERSE_PISTON_VALUE) { | |
23 | driveTrain.extendGearManipulatorPiston(); | |
24 | } else { | |
25 | driveTrain.retractGearManipulatorPiston(); | |
26 | } | |
27 | } | |
28 | ||
29 | @Override | |
30 | protected void execute() { | |
31 | } | |
32 | ||
33 | // Make this return true when this Command no longer needs to run execute() | |
34 | @Override | |
35 | protected boolean isFinished() { | |
36 | return true; | |
37 | } | |
38 | ||
39 | // Called once after isFinished returns true | |
40 | @Override | |
41 | protected void end() { | |
42 | } | |
43 | ||
44 | // Called when another command which requires one or more of the same | |
45 | // subsystems is scheduled to run | |
46 | @Override | |
47 | protected void interrupted() { | |
48 | } | |
49 | } |