Skip to content

Commit 3c3640f

Browse files
separate commands for outtaking algae to barge and processor (#122)
Co-authored-by: DylanTaylor29 <[email protected]>
1 parent 5c1c6de commit 3c3640f

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

src/main/java/frc/robot/Robot.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,13 @@ private void configureDriverButtonBindings() {
248248
.whileTrue(new DriveToPoseCommand(swerve, vision, () -> swerve.getNearestPose()));
249249

250250
// Outtake grippers
251-
driver.HIn()
252-
.whileTrue(coralRoller.createOuttakeCommand()
253-
.alongWith(algaeRoller.createOuttakeCommand()));
254-
251+
var outtaking = driver.HIn();
252+
lifter.atProcessorHeight.and(outtaking)
253+
.whileTrue(algaeRoller.createOuttakeToProcessorCommand());
254+
lifter.atBargeHeight.and(outtaking)
255+
.whileTrue(algaeRoller.createOuttakeToBargeCommand());
256+
outtaking
257+
.whileTrue(coralRoller.createOuttakeCommand());
255258
}
256259

257260
private void configureOperatorButtonBindings() {

src/main/java/frc/robot/elevator/AlgaeRoller.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ public Command createIntakeCommand() {
8989
return this.run(() -> setVoltage(AlgaeRollerConstants.kIntakeVoltage));
9090
}
9191

92-
public Command createOuttakeCommand() {
93-
return this.run(() -> setVoltage(AlgaeRollerConstants.kOuttakeVoltage));
92+
public Command createOuttakeToBargeCommand() {
93+
return this.run(() -> setVoltage(AlgaeRollerConstants.kOuttakeToBargeVoltage));
94+
}
95+
96+
public Command createOuttakeToProcessorCommand() {
97+
return this.run(() -> setVoltage(AlgaeRollerConstants.kOuttakeToProcessorVoltage));
9498
}
9599

96100
public Command createHoldAlgaeCommand() {

src/main/java/frc/robot/elevator/ElevatorConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ public static final class AlgaeRollerConstants {
185185
public static final Voltage kIntakeVoltage = Volts.of(5.0);
186186
// Found 3/9/2025 that 5V applied at stall will draw ~5A, which is acceptable for motor lifetime
187187
public static final Voltage kHoldVoltage = Volts.of(5.0);
188-
public static final Voltage kOuttakeVoltage = kIntakeVoltage.unaryMinus();
188+
public static final Voltage kOuttakeToProcessorVoltage = Volts.of(-5.0);
189+
public static final Voltage kOuttakeToBargeVoltage = Volts.of(-2.5);
189190
}
190191

191192
public static final class AlgaeWristConstants {

src/main/java/frc/robot/elevator/Lifter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ public Boolean inState(LifterState state) {
154154
}
155155

156156
public Trigger atIntakingHeight = new Trigger(() -> inState(LifterState.CoralIntake));
157+
public Trigger atProcessorHeight = new Trigger(() -> inState(LifterState.AlgaeProcessor));
158+
public Trigger atBargeHeight = new Trigger(() -> inState(LifterState.AlgaeBarge));
157159
public Trigger atFloorIntakingHeight = new Trigger(() -> inState(LifterState.AlgaeIntakeFloor));
158160
public Trigger tooHighForCoralWrist =
159161
new Trigger(() -> getCurrentHeight().gt(LifterState.CoralL3.height.plus(Inches.of(2.0))));

0 commit comments

Comments
 (0)