Skip to content

Commit 22d6fc5

Browse files
Increased speed of revolver during ShooterFiringSequence to 100% to help increase firing rate.
1 parent c25fa83 commit 22d6fc5

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@ public ShooterFiringSequence(double waitDuration) {
2525
// super(new FooCommand(), new BarCommand());
2626
super();
2727

28-
// shooting.
28+
// Prepare for shooting.
2929
addCommands(new ParallelCommandGroup( // prepare for shooting,
30-
new AirCompressorPause(), // Turn off compressor while actively shooting,
30+
new AirCompressorPause(), // turn off compressor while actively shooting,
3131
new IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN), // ensure intake is lowered,
32-
new ShooterAimToTarget())); // take one last aim at the target before starting
32+
new ShooterAimToTarget())); // and aim at the target (azimuth and elevation).
3333

34+
// prior command established aim; turn on the shooter wheels and maintain turret
3435
addCommands(new ParallelRaceGroup(new ShooterWheelSetToTarget(true), new TurretAimToTargetContinuously()));
3536

3637
// turn on the feeder, wait 0.1, turn on the Chimney, wait 0.1, turn on the
37-
// revolver turntable, shoot for specified duration
38+
// revolver turntable, shoot for specified duration.
3839
// TODO: should really shoot until no balls detected any more
3940
addCommands(new ParallelRaceGroup( //
4041
new TurretAimToTargetContinuously(), // continue aiming while shooting
4142
new FeederSet(1.0), new SequentialCommandGroup(new Wait(0.1), new ChimneySet(1.0)),
42-
new SequentialCommandGroup(new Wait(0.2), new RevolverSetTurntable(0.5)), new Wait(waitDuration)));
43+
new SequentialCommandGroup(new Wait(0.2), new RevolverSetTurntable(1.0)), new Wait(waitDuration)));
4344

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

src/main/java/org/mayheminc/robot2020/commands/TargetingIsOnTarget.java renamed to src/main/java/org/mayheminc/robot2020/commands/TurretIsOnTarget.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import edu.wpi.first.wpilibj2.command.CommandBase;
1616

17-
public class TargetingIsOnTarget extends CommandBase {
17+
public class TurretIsOnTarget extends CommandBase {
1818
/**
1919
* Creates a new TargetingIsOnTarget.
2020
*/
21-
public TargetingIsOnTarget() {
21+
public TurretIsOnTarget() {
2222
// Use addRequirements() here to declare subsystem dependencies.
2323
}
2424

@@ -30,12 +30,6 @@ public void initialize() {
3030
// Called every time the scheduler runs while the command is scheduled.
3131
@Override
3232
public void execute() {
33-
// double bearingToTarget = RobotContainer.targeting.getBearingToTarget();
34-
// double rangeToTarget = RobotContainer.targeting.getRangeToTarget();
35-
36-
// RobotContainer.shooter.setTurretPositionRel(RobotContainer.shooter.getTurretPosition()
37-
// + bearingToTarget);
38-
// RobotContainer.shooter.setShooterWheelSpeed(Targeting.convertRangeToWheelSpeed(rangeToTarget));
3933
}
4034

4135
// Called once the command ends or is interrupted.
@@ -46,16 +40,9 @@ public void end(boolean interrupted) {
4640
// Returns true when the command should end.
4741
@Override
4842
public boolean isFinished() {
49-
// boolean bearingGood = Math.abs(RobotContainer.targeting.getBearingToTarget())
50-
// < 2;
51-
// boolean wheelsGood =
52-
// Math.abs(Targeting.convertRangeToWheelSpeed(RobotContainer.targeting.getRangeToTarget())
53-
// - RobotContainer.shooter.getShooterWheelSpeed()) < 100;
54-
// return bearingGood && wheelsGood;
55-
5643
double targetPos = RobotContainer.targeting.getDesiredAzimuth();
5744
double turretPos = RobotContainer.turret.getPosition();
5845

59-
return ( Math.abs( targetPos - turretPos) < 50);
46+
return (Math.abs(targetPos - turretPos) < 50);
6047
}
6148
}

0 commit comments

Comments
 (0)