Skip to content

Commit c25fa83

Browse files
Changed shooter wheel to go to "idle speed" (1500rpm) after shooting, instead of turning it off completely (to prevent ball jams from a "stuck" ball in the shooter wheel.) Increased revolver speed for "fast" OI button to full speed (previously half speed), and removed a "dead" file (ShootAndDriveForward.java).
1 parent 7f1baeb commit c25fa83

File tree

11 files changed

+35
-60
lines changed

11 files changed

+35
-60
lines changed

src/main/java/org/mayheminc/robot2020/RobotContainer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ private void configureDriverPadButtons() {
199199
DRIVER_PAD.DRIVER_PAD_BLUE_BUTTON.whenPressed(new ShooterWheelAdjust(50.0));
200200
DRIVER_PAD.DRIVER_PAD_GREEN_BUTTON.whenPressed(new ShooterWheelAdjust(-50.0));
201201
DRIVER_PAD.DRIVER_PAD_RED_BUTTON.whenPressed(new ShooterWheelSetVBus(0.0));
202-
DRIVER_PAD.DRIVER_PAD_YELLOW_BUTTON
203-
.whenPressed(new ShooterWheelSet(RobotContainer.shooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED));
202+
DRIVER_PAD.DRIVER_PAD_YELLOW_BUTTON.whenPressed(new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED));
204203

205204
DRIVER_PAD.DRIVER_PAD_BACK_BUTTON.whileHeld(new DriveStraight(0.1));
206205

@@ -217,7 +216,7 @@ private void configureOperatorStickButtons() {
217216
private void configureOperatorPadButtons() {
218217
OPERATOR_PAD.OPERATOR_PAD_BUTTON_ONE.whileHeld(new RevolverSetTurntable(0.2));
219218
OPERATOR_PAD.OPERATOR_PAD_BUTTON_TWO.whenPressed(new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN));
220-
OPERATOR_PAD.OPERATOR_PAD_BUTTON_THREE.whileHeld(new RevolverSetTurntable(0.5));
219+
OPERATOR_PAD.OPERATOR_PAD_BUTTON_THREE.whileHeld(new RevolverSetTurntable(1.0));
221220
OPERATOR_PAD.OPERATOR_PAD_BUTTON_FOUR.whenPressed(new IntakeSetPosition(RobotContainer.intake.PIVOT_UP));
222221

223222
// new ShooterSetWheel(1000));

src/main/java/org/mayheminc/robot2020/autonomousroutines/ShootAndDriveForward.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/org/mayheminc/robot2020/autonomousroutines/StartBWOppTrench.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public StartBWOppTrench() {
4646

4747
// in shooting position, prepare everything for shooting
4848
addCommands(new ParallelCommandGroup( // run the following commands in parallel:
49-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED),
49+
new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED),
5050
new HoodSetAbsWhileHeld(Hood.INITIATION_LINE_POSITION + 3000.0),
5151
new TurretSetAbs((105.0 * Turret.TICKS_PER_DEGREE), Turret.WAIT_FOR_DONE)));
5252

@@ -60,7 +60,7 @@ public StartBWOppTrench() {
6060
addCommands(new ShooterFiringSequence(5.0));
6161

6262
// turn the shooter wheel and intake off now that the shooting is all done
63-
addCommands(new ShooterWheelSet(0.0));
63+
addCommands(new ShooterWheelSet(ShooterWheel.IDLE_SPEED));
6464
addCommands(new IntakeSetRollers(0.0));
6565

6666
// turn the wheel off now that the shooting is all done

src/main/java/org/mayheminc/robot2020/autonomousroutines/StartBWShoot3.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,12 @@ public StartBWShoot3() {
2727
// is turned towards the target
2828
addCommands(new ParallelCommandGroup( // run the following commands in parallel:
2929
new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN),
30-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED),
30+
new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED),
3131
new HoodSetAbsWhileHeld(Hood.INITIATION_LINE_POSITION),
3232
new TurretSetAbs((180.0 * Turret.TICKS_PER_DEGREE), Turret.WAIT_FOR_DONE)));
3333

3434
addCommands(new ShooterFiringSequence(1.5));
3535

3636
// note that the above turns everything off again when it is done.
37-
38-
// turn the shooter wheel and intake off now that the shooting is all done
39-
// addCommands(new ParallelRaceGroup( // below commands in parallel
40-
// new ShooterWheelSet(0.0), //
41-
// new IntakeSetRollers(0.0), // turn off the rollers
42-
// new HoodSetAbs(Hood.STARTING_POSITION)));
4337
}
4438
}

src/main/java/org/mayheminc/robot2020/autonomousroutines/StartBWTrench.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ public StartBWTrench(double extraDistance) {
4949

5050
// drive diagonally over towards the shooting position, while turning on shooter
5151
// wheels, raising the hood, and re-aiming the turret
52-
addCommands(new ParallelCommandGroup(
53-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED),
52+
addCommands(new ParallelCommandGroup(new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED),
5453
new HoodSetAbsWhileHeld(Hood.INITIATION_LINE_POSITION),
5554
new TurretSetAbs((168.0 * Turret.TICKS_PER_DEGREE)),
5655
new DriveStraightOnHeading(-0.5, DistanceUnits.INCHES, 96, 160)));
@@ -65,7 +64,7 @@ public StartBWTrench(double extraDistance) {
6564
addCommands(new ShooterFiringSequence(6.0));
6665

6766
// turn the shooter wheel and intake off now that the shooting is all done
68-
addCommands(new ShooterWheelSet(0.0));
67+
addCommands(new ShooterWheelSet(ShooterWheel.IDLE_SPEED));
6968
addCommands(new IntakeSetRollers(0.0));
7069

7170
// turn the wheel off now that the shooting is all done

src/main/java/org/mayheminc/robot2020/autonomousroutines/StartFWRendezvous.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public StartFWRendezvous() {
3232
// is turned towards the target
3333
addCommands(new ParallelCommandGroup( // run the following commands in parallel:
3434
new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN),
35-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED),
35+
new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED),
3636
new HoodSetAbs(Hood.INITIATION_LINE_POSITION),
3737
new TurretSetAbs((10.0 * Turret.TICKS_PER_DEGREE), Turret.WAIT_FOR_DONE)));
3838

@@ -63,15 +63,15 @@ public StartFWRendezvous() {
6363

6464
// in shooting position, prepare everything for shooting
6565
addCommands(new ParallelCommandGroup( // run the following commands in parallel:
66-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_TRENCH_FRONT_SPEED),
66+
new ShooterWheelSet(ShooterWheel.TRENCH_FRONT_SPEED),
6767
new TurretSetAbs((0.0 * Turret.TICKS_PER_DEGREE), Turret.WAIT_FOR_DONE)));
6868

6969
// turn on the intake gently while shooting to help balls settle
7070
addCommands(new IntakeSetRollers(-0.2));
7171
addCommands(new ShooterFiringSequence(6.0));
7272

7373
// turn the shooter wheel and intake off now that the shooting is all done
74-
addCommands(new ShooterWheelSet(0.0));
74+
addCommands(new ShooterWheelSet(ShooterWheel.IDLE_SPEED));
7575
addCommands(new IntakeSetRollers(0.0));
7676

7777
// turn the wheel off now that the shooting is all done

src/main/java/org/mayheminc/robot2020/autonomousroutines/StartFWShoot3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ public StartFWShoot3() {
2727
// is turned towards the target
2828
addCommands(new ParallelCommandGroup( // run the following commands in parallel:
2929
new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN),
30-
new ShooterWheelSet(ShooterWheel.SHOOTER_WHEEL_INITIATION_LINE_SPEED),
30+
new ShooterWheelSet(ShooterWheel.INITIATION_LINE_SPEED),
3131
new HoodSetAbsWhileHeld(Hood.INITIATION_LINE_POSITION),
3232
new TurretSetAbs((0.0 * Turret.TICKS_PER_DEGREE), Turret.WAIT_FOR_DONE)));
3333

3434
addCommands(new ShooterReadyAimFire(1.0));
3535

3636
// turn the shooter wheel and intake off now that the shooting is all done
3737
addCommands(new ParallelCommandGroup( // below commands in parallel
38-
new ShooterWheelSet(0.0), //
38+
new ShooterWheelSet(ShooterWheel.IDLE_SPEED), //
3939
new IntakeSetRollers(0.0), // turn off the rollers
4040
new HoodSetAbs(Hood.STARTING_POSITION)));
4141
}

src/main/java/org/mayheminc/robot2020/commands/ShooterCeaseFire.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
package org.mayheminc.robot2020.commands;
99

1010
import org.mayheminc.robot2020.subsystems.Hood;
11+
import org.mayheminc.robot2020.subsystems.ShooterWheel;
12+
1113
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
1214
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
1315

@@ -27,7 +29,7 @@ public ShooterCeaseFire() {
2729
// (feed roller, chimney, revolver, and shooter wheels)
2830

2931
addCommands(new ParallelRaceGroup(new FeederSet(0.0), new ChimneySet(0.0), new RevolverSetTurntable(0.0),
30-
new ShooterWheelSetVBus(0.0), new Wait(0.1)));
32+
new ShooterWheelSet(ShooterWheel.IDLE_SPEED), new Wait(0.1)));
3133

3234
// Lower the hood now that we're done shooting
3335
addCommands(new HoodSetAbsWhileHeld(Hood.STARTING_POSITION));

src/main/java/org/mayheminc/robot2020/commands/ShooterFiringSequence.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
package org.mayheminc.robot2020.commands;
99

10+
import org.mayheminc.robot2020.RobotContainer;
11+
12+
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
1013
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
1114
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
1215

@@ -22,11 +25,11 @@ public ShooterFiringSequence(double waitDuration) {
2225
// super(new FooCommand(), new BarCommand());
2326
super();
2427

25-
// Turn off compressor while actively shooting.
26-
addCommands(new AirCompressorPause());
27-
28-
// one last aim at the target before starting shooting.
29-
addCommands(new ShooterAimToTarget());
28+
// shooting.
29+
addCommands(new ParallelCommandGroup( // prepare for shooting,
30+
new AirCompressorPause(), // Turn off compressor while actively shooting,
31+
new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN), // ensure intake is lowered,
32+
new ShooterAimToTarget())); // take one last aim at the target before starting
3033

3134
addCommands(new ParallelRaceGroup(new ShooterWheelSetToTarget(true), new TurretAimToTargetContinuously()));
3235

@@ -36,7 +39,7 @@ public ShooterFiringSequence(double waitDuration) {
3639
addCommands(new ParallelRaceGroup( //
3740
new TurretAimToTargetContinuously(), // continue aiming while shooting
3841
new FeederSet(1.0), new SequentialCommandGroup(new Wait(0.1), new ChimneySet(1.0)),
39-
new SequentialCommandGroup(new Wait(0.2), new RevolverSetTurntable(0.3)), new Wait(waitDuration)));
42+
new SequentialCommandGroup(new Wait(0.2), new RevolverSetTurntable(0.5)), new Wait(waitDuration)));
4043

4144
// turn off the feeder, chimney, and revolver, ending after 0.1 seconds
4245
addCommands(new ShooterCeaseFire());

src/main/java/org/mayheminc/robot2020/subsystems/ShooterWheel.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ public class ShooterWheel extends SubsystemBase implements PidTunerObject {
2020
private final double SECONDS_PER_MINUTE = 60.0;
2121
private final double HUNDRED_MS_PER_SECOND = 10.0;
2222

23-
public static final double SHOOTER_WHEEL_INITIATION_LINE_SPEED = 3000.0;
24-
public static final double SHOOTER_WHEEL_TRENCH_FRONT_SPEED = 3400.0;
25-
private static final double MAX_SPEED_RPM = 3500;
23+
public static final double IDLE_SPEED = 1500.0;
24+
public static final double INITIATION_LINE_SPEED = 3000.0;
25+
public static final double TRENCH_FRONT_SPEED = 3400.0;
26+
public static final double MAX_SPEED_RPM = 3600;
2627

2728
double m_targetSpeedRPM;
2829

0 commit comments

Comments
 (0)