Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
eshen7 committed Feb 29, 2024
1 parent 61fbf8f commit e7a26d2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/main/java/team3647/frc2024/constants/LEDConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ public class LEDConstants {
new SingleFadeAnimation(0, 255, 0, 0, 0.65, LEDCOUNT);

public static final Animation BREATHE_YELLOW =
new StrobeAnimation(246, 190, 0, 128, 0.8, LEDCOUNT);
new StrobeAnimation(246, 190, 0, 128, 0.3, LEDCOUNT);

public static final Animation BREATHE_PINK =
new StrobeAnimation(255, 0, 255, 128, 0.65, LEDCOUNT);
new StrobeAnimation(255, 0, 255, 128, 0.5, LEDCOUNT);

public static final Animation FLASH_PURPLE =
new StrobeAnimation(162, 25, 255, 128, 0.3, LEDCOUNT);

public static final Animation FLASH_YELLOW =
new StrobeAnimation(246, 190, 0, 128, 0.3, LEDCOUNT);
new StrobeAnimation(246, 190, 0, 128, 0.5, LEDCOUNT);

public static final Animation FLASH_GREEN = new StrobeAnimation(0, 255, 0, 0, 0.3, LEDCOUNT);
public static final Animation FLASH_GREEN = new StrobeAnimation(0, 255, 0, 0, 0.5, LEDCOUNT);

public static final Animation FLASH_BROWN =
new StrobeAnimation(181, 101, 30, 128, 0.3, LEDCOUNT);
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/team3647/frc2024/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public RobotContainer() {
configureButtonBindings();
configureSmartDashboardLogging();
autoCommands.registerCommands();
runningMode = autoCommands.redFour_S1F1F2F3;
runningMode = autoCommands.blueFour_S1F1F2F3;
pivot.setEncoder(PivotConstants.kInitialAngle);
wrist.setEncoder(WristConstants.kInitialDegree);
climb.setEncoder(0);
Expand Down Expand Up @@ -114,10 +114,10 @@ private void configureButtonBindings() {
mainController.leftMidButton.onTrue(autoDrive.enable());
mainController.rightMidButton.onTrue(autoDrive.disable());

mainController
.leftBumper
.and(() -> detector.hasTarget())
.whileTrue(autoDrive.setMode(DriveMode.INTAKE_FLOOR_PIECE));
// mainController
// .leftBumper
// .and(() -> detector.hasTarget())
// .whileTrue(autoDrive.setMode(DriveMode.INTAKE_FLOOR_PIECE));
mainController
.leftBumper
.and(() -> !superstructure.getPiece())
Expand All @@ -131,10 +131,10 @@ private void configureButtonBindings() {
.or(() -> superstructure.getPiece())
.onFalse(superstructure.stowIntake())
.onFalse(superstructure.kickerCommands.kill());
mainController
.leftBumper
.and(() -> detector.hasTarget())
.onFalse(autoDrive.setMode(DriveMode.NONE));
// mainController
// .leftBumper
// .and(() -> detector.hasTarget())
// .onFalse(autoDrive.setMode(DriveMode.NONE));

mainController.buttonA.onTrue(superstructure.ejectPiece());

Expand Down Expand Up @@ -361,7 +361,7 @@ public Command getAutonomousCommand() {
swerve::getOdoPose,
swerve::getChassisSpeeds,
PivotConstants.robotToPivot2d,
true));
false));

public final AutoDrive autoDrive = new AutoDrive(swerve, detector, targetingUtil);

Expand Down
24 changes: 14 additions & 10 deletions src/main/java/team3647/frc2024/subsystems/Superstructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public boolean getPiece() {
}

public boolean currentYes() {
return intake.getMasterCurrent() > 38 && wrist.getAngle() < 5; // 41
return intake.getMasterCurrent() > 42 && wrist.getAngle() < 5; // 41
}

public Command setPiece() {
Expand All @@ -125,7 +125,7 @@ public Command ejectPiece() {
}

public boolean flywheelReadY() {
return shooterLeft.velocityReached(20, 1);
return shooterLeft.velocityReached(15, 1);
}

public Command deployChurro() {
Expand Down Expand Up @@ -166,7 +166,7 @@ public Command shoot() {
}

public boolean aimedAtSpeaker() {
return shooterLeft.velocityGreater(20)
return shooterLeft.velocityGreater(15)
&& pivot.angleReached(pivotAngleSupplier.getAsDouble(), 5)
&& swerveAimed.getAsBoolean();
}
Expand Down Expand Up @@ -236,33 +236,37 @@ public Command prepManual() {

public Command stowFromShoot() {
return Commands.sequence(
Commands.parallel(prep(), spinUp(), feed()).withTimeout(1),
Commands.parallel(prep(), spinUp(), feed()).withTimeout(0.6),
Commands.parallel(
pivotCommands.setAngle(() -> pivotAngleSupplier.getAsDouble()),
shooterCommands.kill(),
kickerCommands.kill())
.withTimeout(1));
.withTimeout(0.1));
}

public Command stowFromAmpShoot() {
return Commands.sequence(
Commands.parallel(prepAmp(), spinUpAmp(), feed()).withTimeout(1),
Commands.parallel(prepAmp(), spinUpAmp(), feed()).withTimeout(0.6),
Commands.parallel(
pivotCommands.setAngle(() -> pivotAngleSupplier.getAsDouble()),
shooterCommands.kill(),
kickerCommands.kill(),
stowChurro())
.withTimeout(1));
.withTimeout(0.2));
}

public boolean hasPiece() {
return getPiece() && (frontPiece() || pivot.backPiece());
}

public Command stowFromBatterShoot() {
return Commands.sequence(
Commands.parallel(batterPrep(), spinUp(), feed()).withTimeout(1),
Commands.parallel(batterPrep(), spinUp(), feed()).withTimeout(0.6),
Commands.parallel(
pivotCommands.setAngle(() -> pivotAngleSupplier.getAsDouble()),
shooterCommands.kill(),
kickerCommands.kill())
.withTimeout(1));
.withTimeout(0.1));
}

public Command intake() {
Expand Down Expand Up @@ -295,7 +299,7 @@ public Command shootThrough() {
.until(() -> pivot.frontPiece())
.andThen(slightReverse().withTimeout(0.1))
// .withTimeout(1)
.andThen(stowIntake());
.andThen(Commands.deadline(stowIntake(), kickerCommands.kill()));
}

public Command shootThroughNoKicker() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/team3647/frc2024/util/AutoDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void periodic() {
}

public boolean swerveAimed() {
return getRot() < 0.3;
return targetRot < 0.1;
}

private void setTargetPose(Pose2d targetPose) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/team3647/frc2024/util/LEDTriggers.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public LEDTriggers(Superstructure superstructure) {
this.superstructure = superstructure;
}

public final Trigger inOutTrigger = new Trigger(() -> superstructure.getPiece());
public final Trigger inOutTrigger = new Trigger(() -> superstructure.hasPiece());

public final Trigger targetTrigger = new Trigger(() -> superstructure.aimedAtSpeaker());

Expand Down

0 comments on commit e7a26d2

Please sign in to comment.