Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 7d801fb

Browse files
changed getStrafeSign() type to return double, and used it as a method reference in STRAFE_SPEED
1 parent f155ae9 commit 7d801fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/frc/robot/commands/auto/YeetAndRetreatAmpSide.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class YeetAndRetreatAmpSide extends SequentialCommandGroup {
1616

1717
private static final double MOVE_TIMEOUT = 4;
1818
private static final Supplier<Double> DRIVE_SPEED = () -> 1.0;
19-
private static final Supplier<Double> STRAFE_SPEED = () -> getStrafeSign() * 1.0;
19+
private static final Supplier<Double> STRAFE_SPEED = YeetAndRetreatAmpSide::getStrafeSign;
2020

2121
//Click A-Stop if necessary!
2222
public YeetAndRetreatAmpSide(Drivetrain drivetrain, Shooter shooter, ShooterAdjuster adjuster, Storage storage,
@@ -31,7 +31,7 @@ public YeetAndRetreatAmpSide(Drivetrain drivetrain, Shooter shooter, ShooterAdju
3131
}
3232

3333
// depending on the alliance, the strafe direction changes as the amps are on opposite sides
34-
private static int getStrafeSign() {
34+
private static double getStrafeSign() {
3535
if (DriverStation.getAlliance().isEmpty()) return 0;
3636
if (DriverStation.getAlliance().get() == DriverStation.Alliance.Red) return 1;
3737
return -1;

0 commit comments

Comments
 (0)