Skip to content

Commit

Permalink
Fairbotics was a myth created by advertisers to sell you more fairs
Browse files Browse the repository at this point in the history
  • Loading branch information
ACat701 committed Jul 26, 2024
1 parent 7eac12e commit 6696d27
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 108 deletions.
15 changes: 1 addition & 14 deletions src/main/java/frc/robot/FieldConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class FieldConstants {
/**
* <b> Units: </b> Meters
*/
// public static double FIELD_LENGTH = 12.85875;
public static double FIELD_LENGTH = 16.541;

/**
Expand All @@ -33,14 +32,8 @@ public class FieldConstants {
* @return An array of field element positions. Your Speaker, Amp, Source, Left
* Stage, Center Stage, Right Stage, Subwoofer, Shuffle
*/
public static Supplier<Pose3d[]> GET_FIELD_POSITIONS(boolean fairbotics) {
public static Supplier<Pose3d[]> GET_FIELD_POSITIONS() {
if (ALLIANCE.isPresent() && ALLIANCE.get().equals(Alliance.Red)) {
if (fairbotics) {
return () -> new Pose3d[] { redConstants.FAIRBOTICS_SPEAKER, redConstants.AMP, redConstants.SOURCE,
redConstants.LEFT_STAGE,
redConstants.CENTER_STAGE, redConstants.RIGHT_STAGE, redConstants.SUBWOOFER, redConstants.SHUFFLE };

}
return () -> new Pose3d[] { redConstants.SPEAKER_CENTER, redConstants.AMP, redConstants.SOURCE,
redConstants.LEFT_STAGE,
redConstants.CENTER_STAGE, redConstants.RIGHT_STAGE, redConstants.SUBWOOFER, redConstants.SHUFFLE };
Expand Down Expand Up @@ -105,12 +98,6 @@ private static final class redConstants {
private static final Pose3d SPEAKER_CENTER = new Pose3d(FIELD_LENGTH - (0.457 / 2), 5.557034, 2.105 - (0.133 / 2),
new Rotation3d(0, 0, 0));

/**
* The coordinate of the center of the red speaker, in meters
*/
private static final Pose3d FAIRBOTICS_SPEAKER = new Pose3d(16.541 - (0.457 / 2), 5.557034, 2.105 - (0.133 / 2),
new Rotation3d(0, 0, 0));

/**
* The coordinate of the center of the red amp, in meters
*/
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import frc.robot.commands.ZeroTurret;
import frc.robot.commands.autos.AutoInterface;
import frc.robot.commands.autos.DefaultAuto;
import frc.robot.commands.autos.Fairbotics1pc;
import frc.robot.commands.autos.PreloadOnly;
import frc.robot.commands.autos.PreloadTaxi;
import frc.robot.commands.autos.WingOnly;
Expand Down Expand Up @@ -180,7 +179,7 @@ private void configureDriverBindings(SN_XboxController controller) {
// Reset Pose
controller.btn_South
.onTrue(Commands.runOnce(
() -> subDrivetrain.resetPoseToPose(FieldConstants.GET_FIELD_POSITIONS(false).get()[6].toPose2d()))
() -> subDrivetrain.resetPoseToPose(FieldConstants.GET_FIELD_POSITIONS().get()[6].toPose2d()))
.alongWith(Commands.runOnce(() -> subDrivetrain.resetDriving(FieldConstants.ALLIANCE))));

controller.btn_LeftTrigger
Expand Down Expand Up @@ -329,9 +328,6 @@ private void configureNumpadBindings(SN_SwitchboardStick switchboardStick) {
}

private void configureAutoSelector() {
autoChooser.setDefaultOption("FAIRBOTICS",
new Fairbotics1pc(subShooter, subIntake, subPitch, subTurret, subTransfer, subClimber, subLEDs));

// PRELOAD ONLY
autoChooser.addOption("Preload S1",
new PreloadOnly(subDrivetrain, subIntake, subLEDs, subPitch, subShooter, subTransfer, subTurret, subClimber,
Expand Down Expand Up @@ -368,7 +364,7 @@ private void configureAutoSelector() {
false));

// Wing ONLY
autoChooser.addOption("Wing Only Down",
autoChooser.setDefaultOption("Wing Only Down",
new WingOnly(subDrivetrain, subIntake, subLEDs, subPitch, subShooter, subTransfer, subTurret, subClimber,
true));

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/AimAuto.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void initialize() {
desiredPitchAngle = subPitch.getPitchAngle();
desiredTurretAngle = Rotation2d.fromDegrees(subTurret.getAngle());

fieldPoses = FieldConstants.GET_FIELD_POSITIONS(true).get();
fieldPoses = FieldConstants.GET_FIELD_POSITIONS().get();
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Drive(
@Override
public void initialize() {
driveSpeed = (isPracticeBot) ? constDrivetrain.pracBot.DRIVE_SPEED : constDrivetrain.DRIVE_SPEED;
fieldPositions = FieldConstants.GET_FIELD_POSITIONS(false).get();
fieldPositions = FieldConstants.GET_FIELD_POSITIONS().get();

sourcePose = fieldPositions[2].toPose2d();
leftStage = fieldPositions[3].toPose2d();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/LockPitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public LockPitch(Pitch subPitch, Drivetrain subDrivetrain) {
public void initialize() {
desiredAngle = subPitch.getPitchAngle();

fieldPoses = FieldConstants.GET_FIELD_POSITIONS(false).get();
fieldPoses = FieldConstants.GET_FIELD_POSITIONS().get();
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/LockTurret.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void initialize() {
@Override
public void execute() {
// This is in execute in case the alliance changes after command init
fieldPoses = FieldConstants.GET_FIELD_POSITIONS(false).get();
fieldPoses = FieldConstants.GET_FIELD_POSITIONS().get();
robotPose = subDrivetrain.getPose();

Optional<Rotation2d> calculatedAngle = subTurret.getDesiredAngleToLock(robotPose, fieldPoses,
Expand Down
84 changes: 0 additions & 84 deletions src/main/java/frc/robot/commands/autos/Fairbotics1pc.java

This file was deleted.

0 comments on commit 6696d27

Please sign in to comment.