Skip to content

Commit

Permalink
Spotless apply
Browse files Browse the repository at this point in the history
  • Loading branch information
NoraZitnick committed Sep 27, 2024
1 parent e2262c9 commit 14564b9
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 45 deletions.
57 changes: 24 additions & 33 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import frc.robot.commands.AmpPreparationCommand;
import frc.robot.commands.DefaultDriveCommand;
import frc.robot.commands.DefenseModeCommand;
import frc.robot.commands.DrivebaseTargetLockCommand;
import frc.robot.commands.HaltDriveCommandsCommand;
import frc.robot.commands.IntakeCommand;
import frc.robot.commands.LoadShooterCommand;
Expand All @@ -51,7 +52,6 @@
import frc.robot.commands.ShootCommand;
import frc.robot.commands.StopIntakeCommand;
import frc.robot.commands.StopShooterCommand;
import frc.robot.commands.DrivebaseTargetLockCommand;
import frc.robot.commands.VibrateHIDCommand;
import frc.robot.subsystems.CANWatchdogSubsystem;
import frc.robot.subsystems.DrivebaseSubsystem;
Expand Down Expand Up @@ -227,7 +227,7 @@ public RobotContainer() {
translationXSupplier,
translationYSupplier,
// anthony.rightBumper(),
()-> false));
() -> false));

rgbSubsystem.setDefaultCommand(
new RGBCommand(
Expand Down Expand Up @@ -359,7 +359,7 @@ private void configureButtonBindings() {
intakeSubsystem, shooterSubsystem, pivotSubsystem, elevatorSubsystem)));

// SHOOT OVERRIDE

// FIXME should be right trigger is move elevator up, left trigger is move elevator down
jacob
.rightTrigger()
Expand All @@ -370,21 +370,22 @@ private void configureButtonBindings() {
jacob
.y()
.whileTrue(
new DrivebaseTargetLockCommand(drivebaseSubsystem, translationXSupplier, translationYSupplier)
new DrivebaseTargetLockCommand(
drivebaseSubsystem, translationXSupplier, translationYSupplier)
.alongWith(new PivotTargetLockCommand(pivotSubsystem, drivebaseSubsystem)));

DoubleSupplier pivotManualRate = () -> modifyAxis(-jacob.getLeftY());

new Trigger(() -> pivotManualRate.getAsDouble() > 0.07)
.onTrue(new PivotManualCommand(pivotSubsystem, pivotManualRate));

DoubleSupplier elevatorDownSupplier = () -> modifyAxis(-jacob.getLeftTriggerAxis());
DoubleSupplier elevatorUpSupplier = () -> modifyAxis(jacob.getLeftTriggerAxis());

new Trigger(() -> elevatorDownSupplier.getAsDouble()<-0.07)
new Trigger(() -> elevatorDownSupplier.getAsDouble() < -0.07)
.onTrue(new ManualElevatorCommand(elevatorDownSupplier, elevatorSubsystem));

new Trigger(() -> elevatorUpSupplier.getAsDouble()>0.07)
new Trigger(() -> elevatorUpSupplier.getAsDouble() > 0.07)
.onTrue(new ManualElevatorCommand(elevatorUpSupplier, elevatorSubsystem));

// SOURCE
Expand All @@ -403,23 +404,19 @@ private void configureButtonBindings() {
intakeSubsystem, shooterSubsystem, pivotSubsystem, elevatorSubsystem)));

// NOTE TO SHOOTER OR SERIALIZER
anthony
.b()
.onTrue(
new LoadShooterCommand(shooterSubsystem, pivotSubsystem, elevatorSubsystem));
anthony.b().onTrue(new LoadShooterCommand(shooterSubsystem, pivotSubsystem, elevatorSubsystem));

jacob
.b()
.onTrue(
new LoadShooterCommand(shooterSubsystem, pivotSubsystem, elevatorSubsystem));
jacob.b().onTrue(new LoadShooterCommand(shooterSubsystem, pivotSubsystem, elevatorSubsystem));
jacob
.a()
.onTrue(
new RotateAngleDriveCommand(
drivebaseSubsystem,
translationXSupplier,
translationYSupplier,
DriverStation.getAlliance().get().equals(Alliance.Red) ? -50 : 50) // FIXME confirm angles
DriverStation.getAlliance().get().equals(Alliance.Red)
? -50
: 50) // FIXME confirm angles
.alongWith(
new AmpPreparationCommand(
pivotSubsystem, elevatorSubsystem, shooterSubsystem, intakeSubsystem)));
Expand All @@ -439,29 +436,23 @@ private void configureButtonBindings() {
drivebaseSubsystem,
translationXSupplier,
translationYSupplier,
DriverStation.getAlliance().get().equals(Alliance.Red) ? -50 : 50) // FIXME confirm angles
DriverStation.getAlliance().get().equals(Alliance.Red)
? -50
: 50) // FIXME confirm angles
.alongWith(
new AmpPreparationCommand(
pivotSubsystem, elevatorSubsystem, shooterSubsystem, intakeSubsystem)));

//PIVOT SETPOINTS
anthony
.povUp().onTrue(
new PivotAngleCommand(pivotSubsystem, 30));

anthony
.povLeft().onTrue(
new PivotAngleCommand(pivotSubsystem, 60));
// PIVOT SETPOINTS
anthony.povUp().onTrue(new PivotAngleCommand(pivotSubsystem, 30));

anthony
.povRight().onTrue(
new PivotAngleCommand(pivotSubsystem, 75));
anthony.povLeft().onTrue(new PivotAngleCommand(pivotSubsystem, 60));

anthony
.povDown().onTrue(
new PivotAngleCommand(pivotSubsystem, 55));
//TRAP CLIMB STUFF
anthony.povRight().onTrue(new PivotAngleCommand(pivotSubsystem, 75));

anthony.povDown().onTrue(new PivotAngleCommand(pivotSubsystem, 55));

// TRAP CLIMB STUFF
// jacob.
// povCenter().onTrue();

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/frc/robot/commands/AmpPreparationCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public AmpPreparationCommand(
} else {
addCommands(
new UnloadShooterCommand(shooterSubsystem, pivotSubsystem, elevatorSubsystem)
.andThen(new IntakeCommand(
intakeSubsystem, shooterSubsystem, pivotSubsystem, elevatorSubsystem))
.andThen(new ElevatorHeightCommand(elevatorSubsystem, Elevator.AMP_HEIGHT)));
.andThen(
new IntakeCommand(
intakeSubsystem, shooterSubsystem, pivotSubsystem, elevatorSubsystem))
.andThen(new ElevatorHeightCommand(elevatorSubsystem, Elevator.AMP_HEIGHT)));
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/IntakeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void initialize() {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(elevatorSubsystem.atTargetHeight()){
if (elevatorSubsystem.atTargetHeight()) {
intakeSubsystem.setIntakeMode(IntakeMode.INTAKE);
shooterSubsystem.setShooterMode(ShooterMode.INTAKE);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/commands/LoadShooterCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class LoadShooterCommand extends Command {
PivotSubsystem pivotSubsystem;

/** Use PivotAndElevatorTransferCommand before running */

public LoadShooterCommand(
ShooterSubsystem shooterSubsystem,
PivotSubsystem pivotSubsystem,
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/frc/robot/commands/ManualElevatorCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

package frc.robot.commands;

import java.util.function.DoubleSupplier;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.ElevatorSubsystem;
import java.util.function.DoubleSupplier;

public class ManualElevatorCommand extends Command {
/** Creates a new ManualElevatorCommand. */
DoubleSupplier directionSupplier;

ElevatorSubsystem elevatorSubsystem;

public ManualElevatorCommand(
DoubleSupplier directionSupplier, ElevatorSubsystem elevatorSubsystem) {
DoubleSupplier directionSupplier, ElevatorSubsystem elevatorSubsystem) {
this.directionSupplier = directionSupplier;
this.elevatorSubsystem = elevatorSubsystem;
addRequirements(elevatorSubsystem);
Expand All @@ -29,9 +30,7 @@ public void initialize() {}
@Override
public void execute() {
elevatorSubsystem.setTargetHeight(
elevatorSubsystem.getElevatorPosition()
+directionSupplier.getAsDouble());

elevatorSubsystem.getElevatorPosition() + directionSupplier.getAsDouble());
}

// Called once the command ends or is interrupted.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/UnloadShooterCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void execute() {
if (elevatorSubsystem.atTargetHeight() && pivotSubsystem.atTargetDegrees()) {
shooterSubsystem.setShooterMode(ShooterMode.SHOOTER_UNLOAD);
}
if (shooterSubsystem.isSerializerBeamBreakSensorTriggered() && pass == false) {
if (shooterSubsystem.isSerializerBeamBreakSensorTriggered() && pass == false) {
pass = true;
}
}
Expand Down

0 comments on commit 14564b9

Please sign in to comment.