Skip to content

Commit afe09a5

Browse files
authored
Strengthen algae hold (#123)
* double voltage setpoint for holding algae * restore missing event binding * increase hold voltage to match competition experience * continue to hold algae after releasing intake button
1 parent 8a20a9c commit afe09a5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private void configureDriverButtonBindings() {
254254
// Outtake grippers
255255
driver.HIn()
256256
.whileTrue(coralRoller.createOuttakeCommand()
257-
.alongWith(algaeRoller.createOuttakeCommand()));
257+
.alongWith(algaeRoller.createOuttakeCommand()));
258258

259259
}
260260

@@ -307,9 +307,11 @@ public boolean getAsBoolean() {
307307
operator.rightTrigger().whileTrue(new ConditionalCommand(
308308
elevator.algaeFloorIntakeCG(), elevator.coralIntakeCG(), algaeMode));
309309

310-
// Intake either coral or algae
311-
operator.rightBumper().whileTrue(new ConditionalCommand(
312-
algaeRoller.createIntakeCommand(), coralRoller.createIntakeCommand(), algaeMode));
310+
// Intake coral and algae
311+
operator.rightBumper()
312+
.whileTrue(algaeRoller.createIntakeCommand()
313+
.alongWith(coralRoller.createIntakeCommand())
314+
.andThen(new ConditionalCommand(algaeRoller.createHoldAlgaeCommand(), algaeRoller.createStopCommand(), algaeRoller.hasAlgae)));
313315

314316
// Force joystick operation of the elevator
315317
Trigger elevatorTriggerHigh = operator.axisGreaterThan(Axis.kLeftY.value, 0.9, loop).debounce(0.1);
@@ -332,6 +334,7 @@ public boolean getAsBoolean() {
332334
}
333335

334336
private void configureEventBindings() {
337+
algaeRoller.hasAlgae.whileTrue(algaeRoller.createHoldAlgaeCommand());
335338
coralRoller.isRolling.whileTrue(createRollerAnimationCommand());
336339
}
337340
// spotless:on

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ public static final class AlgaeRollerConstants {
183183
public static final double kVelocityConversionFactor = kPositionConversionFactor / 60.0;
184184

185185
public static final Voltage kIntakeVoltage = Volts.of(5.0);
186-
public static final Voltage kHoldVoltage = Volts.of(1.0);
186+
// Found 3/9/2025 that 5V applied at stall will draw ~5A, which is acceptable for motor lifetime
187+
public static final Voltage kHoldVoltage = Volts.of(5.0);
187188
public static final Voltage kOuttakeVoltage = kIntakeVoltage.unaryMinus();
188189
}
189190

0 commit comments

Comments
 (0)