Skip to content

Commit 04fbf2a

Browse files
committed
Added backfeed!
1 parent ff0949f commit 04fbf2a

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/main/java/frc/robot/controls/OperatorControls.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,9 @@ public static void configure(int port, SwerveSubsystem drivetrain, Superstructur
4848
controller.a().whileTrue(
4949
superstructure.feedAllCommand()
5050
.finallyDo(() -> superstructure.stopFeedingAllCommand().schedule()));
51+
52+
controller.b().whileTrue(
53+
superstructure.backFeedAllCommand()
54+
.finallyDo(() -> superstructure.stopFeedingAllCommand().schedule()));
5155
}
5256
}

src/main/java/frc/robot/subsystems/HopperSubsystem.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public Command feedCommand() {
5858
return hopper.set(HOPPER_SPEED).finallyDo(() -> smc.setDutyCycle(0)).withName("Hopper.Feed");
5959
}
6060

61+
public Command backFeedCommand() {
62+
return hopper.set(-HOPPER_SPEED).finallyDo(() -> smc.setDutyCycle(0)).withName("Hopper.BackFeed");
63+
}
64+
6165
/**
6266
* Command to run the hopper in reverse while held.
6367
*/

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ public Command deployAndRollCommand() {
124124
}).withName("Intake.DeployAndRoll");
125125
}
126126

127+
public Command backFeedAndRollCommand() {
128+
return Commands.run(() -> {
129+
setIntakeDeployed();
130+
smc.setDutyCycle(-INTAKE_SPEED);
131+
}, this).finallyDo(() -> {
132+
smc.setDutyCycle(0);
133+
setIntakeHold();
134+
}).withName("Intake.BackFeedAndRoll");
135+
}
136+
127137
private void setIntakeStow() {
128138
intakePivotController.setPosition(Degrees.of(0));
129139
}

src/main/java/frc/robot/subsystems/Superstructure.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ public Command feedAllCommand() {
249249
intake.setPivotAngle(Degrees.of(46)).asProxy()).withName("Superstructure.feedAll");
250250
}
251251

252+
public Command backFeedAllCommand() {
253+
return Commands.parallel(
254+
hopper.backFeedCommand().asProxy(),
255+
intake.backFeedAndRollCommand().asProxy()).withName("Superstructure.backFeedAll");
256+
}
257+
252258
// public Command intakeBounceCommand() {
253259
// return Commands.sequence(
254260
// Commands.runOnce(() -> intake.setPivotAngle(Degrees.of(115))).asProxy()

0 commit comments

Comments
 (0)