Skip to content

Commit

Permalink
mapped buttons, updated outtake
Browse files Browse the repository at this point in the history
renamed spinOut to SpinOutL1 and created variation for L2-L3
  • Loading branch information
Liammurray19 committed Jan 11, 2025
1 parent f102feb commit 89a84ff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/CommandSequences.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ public Command setRumble(ButtonXboxController controller, int rumbleAmount) {
controller.getHID().setRumble(RumbleType.kBothRumble, rumbleAmount);
});
}

public Command resetAll() {
return drive.resetCmd().andThen(outtake.resetCmd(), algaeDestage.resetCmd());
}
}
7 changes: 6 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@ public void disabledInit() {

@Override
public void configureButtonBindings() {
driveController.back().onTrue(drive.resetCmd());
driveController.back().onTrue(commandSequences.resetAll());
driveController.leftBumper()
.whileTrue(drive.robotCentricDrive());

driveController.a().onTrue(outtake.spinIn());
driveController.b().whileTrue(outtake.spinOut());
driveController.x().whileTrue(outtake.spinOutL1());
driveController.y().whileTrue(algaeDestage.destageAlgae());

}

@Override
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/frc/robot/subsystems/Outtake.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static edu.wpi.first.wpilibj2.command.Commands.waitSeconds;

import com.chopshop166.chopshoplib.logging.LoggedSubsystem;
import com.chopshop166.chopshoplib.motors.SmartMotorController;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.maps.subsystems.OuttakeMap;
Expand All @@ -21,13 +20,20 @@ public Outtake(OuttakeMap outtakeMap) {
super(new Data(), outtakeMap);
}

public Command spinOut() {
public Command spinOutL1() {
return run(() -> {
getData().leftWheel.setpoint = RELEASE_SPEEDLEFT;
getData().rightWheel.setpoint = RELEASE_SPEEDRIGHT;
}).until(() -> !getData().gamePieceDetected).andThen(waitSeconds(RELEASE_DELAY), safeStateCmd());
}

public Command spinOut() {
return run(() -> {
getData().leftWheel.setpoint = RELEASE_SPEEDRIGHT;
getData().rightWheel.setpoint = RELEASE_SPEEDRIGHT;
}).until(() -> !getData().gamePieceDetected).andThen(waitSeconds(RELEASE_DELAY), safeStateCmd());
}

public Command spinIn() {
return run(() -> {
getData().leftWheel.setpoint = INTAKE_SPEED;
Expand Down

0 comments on commit 89a84ff

Please sign in to comment.