Skip to content

Commit

Permalink
refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
rgodha24 committed Feb 27, 2024
1 parent 6859ba2 commit 61dec5d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
12 changes: 6 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ private void configureButtonBindings() {
var stopWithXButton = new Trigger(() -> driver.getRawButton(2));
stopWithXButton.onTrue(Commands.runOnce(drive::stopWithX, drive));

operator.a().toggleOnTrue(intake.onCommand());
operator.b().toggleOnTrue(intake.offCommand());
operator.rightBumper().toggleOnTrue(shooter.shootersOnCommand());
operator.leftBumper().toggleOnTrue(shooter.shootersOffCommand());
operator.x().toggleOnTrue(shooter.conveyorOnCommand());
operator.y().toggleOnTrue(shooter.conveyorOffCommand());
operator.a().toggleOnTrue(Commands.runOnce(intake::on, intake));
operator.b().toggleOnTrue(Commands.runOnce(intake::off, intake));
operator.rightBumper().toggleOnTrue(Commands.runOnce(shooter::shootersOn, shooter));
operator.leftBumper().toggleOnTrue(Commands.runOnce(shooter::shootersOff, shooter));
operator.x().toggleOnTrue(Commands.runOnce(shooter::conveyorOn, shooter));
operator.y().toggleOnTrue(Commands.runOnce(shooter::conveyorOff, shooter));

pivot.setDefaultCommand(
PivotCommands.basicOperatorControl(
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/frc/robot/subsystems/intake/Intake.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package frc.robot.subsystems.intake;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.IntakeConstants;
import org.littletonrobotics.junction.Logger;
Expand Down Expand Up @@ -31,14 +29,6 @@ public void off() {
SmartDashboard.putString("intake", "off");
}

public Command onCommand() {
return new InstantCommand(this::on, this);
}

public Command offCommand() {
return new InstantCommand(this::off, this);
}

public double getCurrent() {
return inputs.current;
}
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/frc/robot/subsystems/shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,4 @@ public void conveyorOn() {
public void conveyorOff() {
io.setConveyorPower(0);
}

public Command shootersOnCommand() {
return new InstantCommand(this::shootersOn, this);
}

public Command shootersOffCommand() {
return new InstantCommand(this::shootersOff, this);
}

public Command conveyorOnCommand() {
return new InstantCommand(this::conveyorOn, this);
}

public Command conveyorOffCommand() {
return new InstantCommand(this::conveyorOff, this);
}
}

0 comments on commit 61dec5d

Please sign in to comment.