Skip to content

Commit

Permalink
added lower pass angle that does not change the robot angle
Browse files Browse the repository at this point in the history
  • Loading branch information
2491NoMythic committed Apr 30, 2024
1 parent 6cbf980 commit d5710e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void shooterInst() {
}
private void angleShooterInst(){
angleShooterSubsystem = new AngleShooterSubsystem();
defaultShooterAngleCommand = new AimShooter(angleShooterSubsystem, AmpAngleSup, HumanPlaySup, SubwooferAngleSup, StageAngleSup, GroundIntakeSup, FarStageAngleSup, OverStagePassSup, OppositeStageShotSup);
defaultShooterAngleCommand = new AimShooter(angleShooterSubsystem, AmpAngleSup, HumanPlaySup, SubwooferAngleSup, StageAngleSup, GroundIntakeSup, FarStageAngleSup, OverStagePassSup, OppositeStageShotSup, CenterAmpPassSup);
angleShooterSubsystem.setDefaultCommand(defaultShooterAngleCommand);
}
private void intakeInst() {
Expand Down Expand Up @@ -607,8 +607,8 @@ public void execute() {
}
if(angleShooterExists) {
//the same command that we use during teleop, but all the buttons that would aim the shooter anywhere other than the speaker are set to false.
NamedCommands.registerCommand("autoAimAtSpeaker", new AimShooter(angleShooterSubsystem, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false));
SmartDashboard.putData("autoAimAtSpeaker", new AimShooter(angleShooterSubsystem, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false));
NamedCommands.registerCommand("autoAimAtSpeaker", new AimShooter(angleShooterSubsystem, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false));
SmartDashboard.putData("autoAimAtSpeaker", new AimShooter(angleShooterSubsystem, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false, ()->false));
}
if (indexerExists&&intakeExists) {
NamedCommands.registerCommand("groundIntake", new AutoGroundIntake(indexer, intake, driveTrain));
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/commands/AimShooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class AimShooter extends Command {
BooleanSupplier farStageAngleSup;
BooleanSupplier OverStageAngleSup;
BooleanSupplier OppositeStageShotSup;
BooleanSupplier LowPassAngleSup;
/**
* A Command that will control the angle of the shooter. If none of the supplied buttons are pressed, than it will automatically aim at the speaker
* @param angleShooterSubsystem the subsytem to control the angle of the shooter
Expand All @@ -33,7 +34,7 @@ public class AimShooter extends Command {
* @param OppositeStageShotSup button to press to aim at the speaker from the opposite side of the stage (from the speaker)
*/
public AimShooter(AngleShooterSubsystem angleShooterSubsystem, BooleanSupplier AmpSup, BooleanSupplier humanPlayerSupplier,
BooleanSupplier SubwooferSupplier1, BooleanSupplier StageAngleSupplier, BooleanSupplier groundIntakeSup, BooleanSupplier farStageAngleSup, BooleanSupplier OverStageAngleSup, BooleanSupplier OppositeStageShotSup) {
BooleanSupplier SubwooferSupplier1, BooleanSupplier StageAngleSupplier, BooleanSupplier groundIntakeSup, BooleanSupplier farStageAngleSup, BooleanSupplier OverStageAngleSup, BooleanSupplier OppositeStageShotSup, BooleanSupplier LowPassAngleSup) {
this.angleShooterSubsystem = angleShooterSubsystem;
this.AmpSup = AmpSup;
this.humanPlayerSupplier = humanPlayerSupplier;
Expand All @@ -43,6 +44,7 @@ public AimShooter(AngleShooterSubsystem angleShooterSubsystem, BooleanSupplier A
this.farStageAngleSup = farStageAngleSup;
this.OverStageAngleSup = OverStageAngleSup;
this.OppositeStageShotSup = OppositeStageShotSup;
this.LowPassAngleSup = LowPassAngleSup;
addRequirements(angleShooterSubsystem);
}

Expand Down Expand Up @@ -70,6 +72,8 @@ public void execute() {
angleShooterSubsystem.setDesiredShooterAngle(ShooterConstants.OVER_STAGE_PASS_ANGLE);
} else if(OppositeStageShotSup.getAsBoolean()) {
angleShooterSubsystem.setDesiredShooterAngle(Field.OPPOSITE_STAGE_SHOOTER_ANGLE);
} else if (LowPassAngleSup.getAsBoolean()) {
angleShooterSubsystem.setDesiredShooterAngle(12);
} else {
angleShooterSubsystem.setDesiredShooterAngle(angleShooterSubsystem.calculateSpeakerAngle());
}
Expand Down

0 comments on commit d5710e3

Please sign in to comment.