Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low pass setpoint #133

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading