Skip to content

Commit eb6b40b

Browse files
committed
auto tings
1 parent f8c2ac9 commit eb6b40b

File tree

13 files changed

+54
-31
lines changed

13 files changed

+54
-31
lines changed

.run/Format.run.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration default="false" name="Format" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
44
<option name="executionName" />
5-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$/Competition2024" />
66
<option name="externalSystemIdString" value="GRADLE" />
77
<option name="scriptParameters" value="" />
88
<option name="taskDescriptions">
@@ -18,7 +18,6 @@
1818
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
1919
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
2020
<DebugAllEnabled>false</DebugAllEnabled>
21-
<RunAsTest>false</RunAsTest>
2221
<method v="2" />
2322
</configuration>
2423
</component>

src/main/deploy/pathplanner/autos/CenterSpeaker2NoteCloseMid.auto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
"name": "ShootNote"
2424
}
2525
},
26+
{
27+
"type": "wait",
28+
"data": {
29+
"waitTime": 0.5
30+
}
31+
},
2632
{
2733
"type": "parallel",
2834
"data": {
@@ -40,7 +46,7 @@
4046
{
4147
"type": "wait",
4248
"data": {
43-
"waitTime": 0.1
49+
"waitTime": 0.5
4450
}
4551
},
4652
{
@@ -72,4 +78,4 @@
7278
},
7379
"folder": "Center Speaker",
7480
"choreoAuto": false
75-
}
81+
}

src/main/java/frc/robot/Autos.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,18 @@ private Command intakeUntilNoteAndPrepareShot() {
123123
return Commands.print("Intaking");
124124
}
125125
return Commands.deadline(
126-
IntakingCommands.intakeUntilDetected(
127-
intakeSubsystem, slapdownSuperstructure, transportSubsystem),
128-
ElevatorWristCommands.elevatorWristIntakePosition(elevatorSubsystem, wristSubsystem))
126+
Commands.parallel(
127+
IntakingCommands.intakeUntilDetected(
128+
intakeSubsystem, slapdownSuperstructure, transportSubsystem),
129+
ElevatorWristCommands.elevatorWristIntakePosition(elevatorSubsystem, wristSubsystem)
130+
.until(
131+
ElevatorWristCommands.elevatorWristToleranceTrigger(
132+
elevatorSubsystem, wristSubsystem))))
129133
.andThen(
130134
Commands.parallel(
131135
ElevatorWristCommands.elevatorWristCloseSpeakerCommand(
132136
elevatorSubsystem, wristSubsystem),
133-
ScoringCommands.shootSetpointCloseSpeakerCommand(shooterSubsystem)));
137+
ScoringCommands.shootSetpointCloseSpeakerCommand(shooterSubsystem)).until(() -> true)).andThen(Commands.print("I WANT TO SHOOT"));
134138
}
135139

136140
public Command autoStart() {
@@ -146,14 +150,14 @@ private Command shootNote() {
146150
return Commands.print("Shooting Note!").andThen(Commands.waitSeconds(0.5));
147151
}
148152
return Commands.deadline(
149-
Commands.sequence(
150-
shooterAndElevatorWristInToleranceCommand(),
151-
ScoringCommands.transportCloseSpeakerCommand(transportSubsystem)
152-
.until(() -> !transportSubsystem.atSensor()))
153-
.andThen(Commands.waitSeconds(0.1), transportSubsystem.stopMovementCommand()),
154-
ScoringCommands.shootSetpointCloseSpeakerCommand(shooterSubsystem),
155-
ElevatorWristCommands.elevatorWristCloseSpeakerCommand(
156-
elevatorSubsystem, wristSubsystem));
153+
Commands.sequence(
154+
Commands.print("I LOVE SHOOTING"),
155+
shooterAndElevatorWristInToleranceCommand(),
156+
ScoringCommands.transportCloseSpeakerCommand(transportSubsystem)
157+
.until(() -> !transportSubsystem.atSensor()))
158+
.andThen(Commands.waitSeconds(0.1), transportSubsystem.stopMovementCommand()),
159+
ScoringCommands.shootSetpointCloseSpeakerCommand(shooterSubsystem),
160+
ElevatorWristCommands.elevatorWristCloseSpeakerCommand(elevatorSubsystem, wristSubsystem));
157161
}
158162

159163
private Command shooterAndElevatorWristInToleranceCommand() {

src/main/java/frc/robot/RobotContainer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ private void configureLEDs() {
9393
new LEDState(
9494
() -> Alert.getDefaultGroup().hasAnyErrors(),
9595
new AlternatePattern(2.0, Color.kRed, Color.kBlack)),
96+
new LEDState(
97+
() -> DriverStation.isTeleopEnabled() && elevatorSubsystem.atBottomLimit() && wristSubsystem.atBottom(),
98+
new SolidPattern(Color.kGreen)
99+
),
96100
// Default disabled pattern
97101
new LEDState(
98102
DriverStation::isDisabled,

src/main/java/frc/robot/commands/ElevatorWristCommands.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ public static Command elevatorWristIntakePosition(
2323

2424
public static Command elevatorWristInToleranceCommand(
2525
ElevatorSubsystem elevatorSubsystem, WristSubsystem wristSubsystem) {
26-
return Commands.waitUntil(new Trigger(elevatorSubsystem::atGoal).and(wristSubsystem::atGoal));
26+
return Commands.waitUntil(elevatorWristToleranceTrigger(elevatorSubsystem, wristSubsystem));
27+
}
28+
29+
public static Trigger elevatorWristToleranceTrigger(
30+
ElevatorSubsystem elevatorSubsystem, WristSubsystem wristSubsystem) {
31+
return new Trigger(elevatorSubsystem::atGoal).and(wristSubsystem::atGoal);
2732
}
2833

2934
public static Command elevatorWristCloseSpeakerCommand(

src/main/java/frc/robot/commands/IntakingCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public static Command intakeUntilDetected(
2121
.unless(transport::atSensor)
2222
.andThen(
2323
Commands.parallel(
24-
intake.setIntakeVoltageCommand(0.0), transport.setVoltageCommand(0.0)));
24+
intake.stopCommand(), transport.stopMovementCommand()));
2525
}
2626
}

src/main/java/frc/robot/subsystems/elevator/ElevatorSubsystem.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ public Command sysIdDynamic(SysIdRoutine.Direction direction) {
261261

262262
@Override
263263
public void periodic() {
264-
// TODO: make this or elegant
265-
if (atBottomLimit()) {
264+
if (atBottomLimit() && !isHomed) {
266265
isHomed = true;
267266
setEncoderPosition(0.0);
268267
}

src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,8 @@ public Command checkIntakeCommand() {
9191
public Command setIntakeVoltageCommand(double voltage) {
9292
return this.run(() -> this.setIntakeVoltage(voltage));
9393
}
94+
95+
public Command stopCommand() {
96+
return this.runOnce(() -> setIntakeVoltage(0.0));
97+
}
9498
}

src/main/java/frc/robot/subsystems/led/LEDSubsystem.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,27 @@ public LEDSubsystem() {
2525
int i = 0;
2626
splitBuffers[0] = ledBuffer.split(0, FRONT_LEFT_SIZE);
2727
if (FRONT_LEFT_SIZE < MAX_SIZE) {
28-
splitBuffers[0] =
29-
splitBuffers[0].concatenate(new FakeLEDBuffer(MAX_SIZE - FRONT_LEFT_SIZE));
28+
splitBuffers[0] = splitBuffers[0].concatenate(new FakeLEDBuffer(MAX_SIZE - FRONT_LEFT_SIZE));
3029
}
3130
i += FRONT_LEFT_SIZE;
3231

3332
splitBuffers[1] = ledBuffer.split(i, i + BACK_LEFT_SIZE);
3433
splitBuffers[1] = splitBuffers[1].reversed();
3534
if (BACK_LEFT_SIZE < MAX_SIZE) {
36-
splitBuffers[1] =
37-
splitBuffers[1].concatenate(new FakeLEDBuffer(MAX_SIZE - BACK_LEFT_SIZE));
35+
splitBuffers[1] = splitBuffers[1].concatenate(new FakeLEDBuffer(MAX_SIZE - BACK_LEFT_SIZE));
3836
}
3937
i += BACK_LEFT_SIZE;
4038

4139
splitBuffers[2] = ledBuffer.split(i, i + BACK_RIGHT_SIZE);
4240
if (BACK_RIGHT_SIZE < MAX_SIZE) {
43-
splitBuffers[2] =
44-
splitBuffers[2].concatenate(new FakeLEDBuffer(MAX_SIZE - BACK_RIGHT_SIZE));
41+
splitBuffers[2] = splitBuffers[2].concatenate(new FakeLEDBuffer(MAX_SIZE - BACK_RIGHT_SIZE));
4542
}
4643
i += BACK_RIGHT_SIZE;
4744

4845
splitBuffers[3] = ledBuffer.split(i, i + FRONT_RIGHT_SIZE);
4946
splitBuffers[3] = splitBuffers[3].reversed();
5047
if (FRONT_RIGHT_SIZE < MAX_SIZE) {
51-
splitBuffers[3] =
52-
splitBuffers[3].concatenate(new FakeLEDBuffer(MAX_SIZE - FRONT_RIGHT_SIZE));
48+
splitBuffers[3] = splitBuffers[3].concatenate(new FakeLEDBuffer(MAX_SIZE - FRONT_RIGHT_SIZE));
5349
}
5450
i += FRONT_RIGHT_SIZE;
5551

src/main/java/frc/robot/subsystems/slapdown/SlapdownFeederSubsystem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class SlapdownFeederSubsystem extends SubsystemBase {
2929
public SlapdownFeederSubsystem() {
3030
configMotors();
3131

32-
setDefaultCommand(setVoltageCommand(0.0).ignoringDisable(true).withName("SlapdownFeederDefault"));
32+
setDefaultCommand(
33+
setVoltageCommand(0.0).ignoringDisable(true).withName("SlapdownFeederDefault"));
3334
}
3435

3536
private void configMotors() {

0 commit comments

Comments
 (0)