Skip to content

Commit 6b6035f

Browse files
committed
Final changes for districts
1 parent b16d37e commit 6b6035f

File tree

4 files changed

+22
-26
lines changed

4 files changed

+22
-26
lines changed

gradlew

100644100755
File mode changed.

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ public void disabledPeriodic() {
215215

216216
@Override
217217
public void autonomousInit() {
218-
autoSelector.get().ifPresent(auto ->
219-
auto.getInitialPose().ifPresent(pose -> swerve.resetOdometry(pose)));
218+
autoSelector
219+
.get()
220+
.ifPresent(auto -> auto.getInitialPose().ifPresent(pose -> swerve.resetOdometry(pose)));
220221
swerve.setDefaultCommand(swerve.createStopCommand());
221222
lifter.setDefaultCommand(lifter.remainAtCurrentHeight());
222223
leds.replaceDefaultCommandImmediately(
@@ -256,7 +257,7 @@ public void testPeriodic() {}
256257
Gamepiece getLoadedGamepiece() {
257258
if (coralRoller.hasCoral.getAsBoolean()) {
258259
return Gamepiece.CORAL;
259-
}
260+
}
260261
if (algaeRoller.hasAlgae.getAsBoolean()) {
261262
return Gamepiece.ALGAE;
262263
}

src/main/java/frc/robot/auto/L4MultiAuto.java

+17-23
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
import frc.robot.elevator.Elevator;
88

99
public abstract class L4MultiAuto extends AutoMode {
10-
protected final String name;
11-
protected final CoralRoller coralRoller;
12-
protected final Elevator elevator;
10+
protected final String name;
11+
protected final CoralRoller coralRoller;
12+
protected final Elevator elevator;
13+
14+
public L4MultiAuto(String name, Drivetrain drivetrain, Elevator elevatorSystem) {
15+
super(drivetrain);
16+
this.name = name;
17+
elevator = elevatorSystem;
18+
coralRoller = elevator.getCoralRoller();
19+
}
1320

14-
public L4MultiAuto(String name, Drivetrain drivetrain, Elevator elevatorSystem) {
15-
super(drivetrain);
16-
this.name = name;
17-
elevator = elevatorSystem;
18-
coralRoller = elevator.getCoralRoller();
19-
}
21+
@Override
22+
public String getName() {
23+
return name;
24+
}
2025

21-
@Override
22-
public String getName() {
23-
return name;
24-
}
25-
26-
/**
26+
/**
2727
* Attempts to score a coral at L4 height when the provided trajectory finishes.
2828
*
2929
* <p>As the robot approaches the scoring position, the elevator is raised. The coral is jiggled
@@ -50,13 +50,7 @@ protected void scoreToL4Then(
5050
* @param nextAction an action to perform after the coral is grabbed
5151
*/
5252
protected void grabSomeCoralThen(AutoTrajectory sourceTrajectory, Command nextAction) {
53-
sourceTrajectory
54-
.done()
55-
.onTrue(coralRoller.intake().until(coralRoller.hasCoral));
56-
sourceTrajectory
57-
.doneDelayed(1.0)
58-
.onTrue(nextAction);
53+
sourceTrajectory.done().onTrue(coralRoller.intake().until(coralRoller.hasCoral));
54+
sourceTrajectory.doneDelayed(1.0).onTrue(nextAction);
5955
}
60-
61-
6256
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public void periodic() {
6969
SmartDashboard.putNumber("Algae Roller/Velocity", encoder.getVelocity());
7070
SmartDashboard.putNumber("Algae Roller/Applied Duty Cycle", leaderMotor.getAppliedOutput());
7171
SmartDashboard.putNumber("Algae Roller/Current", leaderMotor.getOutputCurrent());
72+
7273
SmartDashboard.putNumber("Algae Roller/Follower Current", followerMotor.getOutputCurrent());
7374
SmartDashboard.putBoolean("Algae Loaded", hasAlgae.getAsBoolean());
7475
SmartDashboard.putBoolean("Algae isRolling", isRolling.getAsBoolean());

0 commit comments

Comments
 (0)