Skip to content

Commit 73454db

Browse files
authored
Merge pull request #236 from strykeforce/rliu/trident
Rliu/trident
2 parents 0bcdacf + d781c69 commit 73454db

File tree

8 files changed

+27
-15
lines changed

8 files changed

+27
-15
lines changed

src/main/java/frc/team2767/deepspace/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void autonomousInit() {
113113
@Override
114114
public void teleopInit() {
115115
DRIVE.sandstormAxisFlip(false);
116-
VACUUM.setSolenoidsState(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP);
116+
VACUUM.setSolenoidsState(VacuumSubsystem.SolenoidStates.HATCH_PICKUP);
117117
}
118118

119119
@Override

src/main/java/frc/team2767/deepspace/command/approach/sequences/AutoHatchPickupCommandGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public AutoHatchPickupCommandGroup() {
3131
});
3232

3333
addSequential(new PressureSetCommand(VacuumSubsystem.kHatchPressureInHg), 0.02);
34-
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
34+
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
3535
addParallel(new ReleaseKrakenCommand(false)); // Don't want kraken in teleop
3636
addParallel(new BallToHatchAutoSafetyCommand());
3737
addSequential(new VisionAutoAlignPickupCommand());

src/main/java/frc/team2767/deepspace/command/approach/sequences/HatchPickupCommandGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public HatchPickupCommandGroup() {
3434
});
3535

3636
addSequential(new PressureSetCommand(VacuumSubsystem.kHatchPressureInHg), 0.3);
37-
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
37+
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
3838
addSequential(new TalonConfigCommand(DriveSubsystem.DriveTalonConfig.YAW_CONFIG));
3939
addSequential(new QueryPyeyeCommand());
4040
addSequential(new CalculateRotationCommand());

src/main/java/frc/team2767/deepspace/command/sequences/pickup/CoconutPickupCommandGroup.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public CoconutPickupCommandGroup() {
2626
new CommandGroup() {
2727
{
2828
addSequential(
29-
new SetSolenoidStatesCommand(
30-
VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
29+
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.CARGO_PICKUP));
3130
addSequential(new PressureSetCommand(VacuumSubsystem.kBallPressureInHg), 0.5);
3231
}
3332
});
@@ -40,7 +39,7 @@ public CoconutPickupCommandGroup() {
4039
new CommandGroup() {
4140
{
4241
addParallel(
43-
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
42+
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
4443
addParallel(new ElevatorDownFastOpenLoopCommand());
4544
}
4645
});*/

src/main/java/frc/team2767/deepspace/command/sequences/pickup/PlayerHatchCommandGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class PlayerHatchCommandGroup extends CommandGroup {
1818
public PlayerHatchCommandGroup() {
1919
addSequential(new LogCommand("BEGIN PLAYER HATCH PICKUP"));
2020
addSequential(new ApproachDirectionCommand());
21-
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
21+
addSequential(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
2222
// addParallel(new AlignToFieldPickupCommand());
2323
addParallel(new PressureSetCommand(VacuumSubsystem.kHatchPressureInHg), 0.02);
2424
addParallel(new BiscuitMoveSafeCommand());

src/main/java/frc/team2767/deepspace/command/sequences/pickup/SandstormHatchPickupCommandGroup.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public SandstormHatchPickupCommandGroup() {
2525
new CommandGroup() {
2626
{
2727
addParallel(new PressureSetCommand(VacuumSubsystem.kHatchPressureInHg), 0.05);
28-
addParallel(
29-
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
28+
addParallel(new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
3029
addParallel(new SetActionCommand(Action.PLACE));
3130
addParallel(new SetGamePieceCommand(GamePiece.HATCH));
3231
addParallel(new SetFieldDirectionCommand(FieldDirection.LEFT));

src/main/java/frc/team2767/deepspace/control/SmartDashboardControls.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ private void addTestCommands() {
235235
private void addVacuumCommands() {
236236
SmartDashboard.putData("Vacuum/cool", new VacuumCooldownCommandGroup());
237237
SmartDashboard.putData(
238-
"Pit/GamePiece",
239-
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.GAME_PIECE_PICKUP));
238+
"Pit/GamePiece", new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.HATCH_PICKUP));
240239
SmartDashboard.putData(
241240
"Pit/PressureAccumulate",
242241
new SetSolenoidStatesCommand(VacuumSubsystem.SolenoidStates.PRESSURE_ACCUMULATE));

src/main/java/frc/team2767/deepspace/subsystem/VacuumSubsystem.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class VacuumSubsystem extends Subsystem implements Item {
4646
private final int STABLE_THRESHOLD_CLIMB = 2;
4747
private final Solenoid tridentSolenoid = new Solenoid(0, Valve.TRIDENT.ID);
4848
private final Solenoid climbSolenoid = new Solenoid(0, Valve.CLIMB.ID);
49+
private final Solenoid cargoSolenoid = new Solenoid(0, Valve.CARGO.ID);
4950
private final TalonSRX vacuum = new TalonSRX(VACUUM_ID);
5051
private final AnalogInput analogInput = new AnalogInput(TEMPERATURE_ID);
5152
private final AnalogInput climbPressure = new AnalogInput(CLIMB_PRESSURE);
@@ -131,22 +132,34 @@ public Solenoid getClimbSolenoid() {
131132
return climbSolenoid;
132133
}
133134

135+
public Solenoid getCargoSolenoid() {
136+
return cargoSolenoid;
137+
}
138+
134139
public void setSolenoidsState(SolenoidStates state) {
135140
switch (state) {
136141
case CLIMB:
137142
climbSolenoid.set(true);
138143
tridentSolenoid.set(false);
144+
cargoSolenoid.set(false);
139145
climbing = true;
140146
break;
141147
case STOP: // fall through
142148
case PRESSURE_ACCUMULATE:
143149
climbSolenoid.set(false);
144150
tridentSolenoid.set(false);
151+
cargoSolenoid.set(false);
145152
break;
146153
case COOL_DOWN: // fall through
147-
case GAME_PIECE_PICKUP:
154+
case HATCH_PICKUP:
148155
tridentSolenoid.set(true);
149156
climbSolenoid.set(false);
157+
cargoSolenoid.set(false);
158+
break;
159+
case CARGO_PICKUP:
160+
tridentSolenoid.set(false);
161+
climbSolenoid.set(false);
162+
cargoSolenoid.set(true);
150163
break;
151164
default:
152165
logger.warn("could not set to {}", state);
@@ -302,7 +315,8 @@ public double getClimbPressure() {
302315

303316
public enum Valve {
304317
TRIDENT(0),
305-
CLIMB(2);
318+
CLIMB(2),
319+
CARGO(3);
306320

307321
public final int ID;
308322

@@ -314,8 +328,9 @@ public enum Valve {
314328
public enum SolenoidStates {
315329
PRESSURE_ACCUMULATE,
316330
CLIMB,
317-
GAME_PIECE_PICKUP,
331+
HATCH_PICKUP,
318332
STOP,
319-
COOL_DOWN
333+
COOL_DOWN,
334+
CARGO_PICKUP
320335
}
321336
}

0 commit comments

Comments
 (0)