Skip to content

Commit

Permalink
Fix party button attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitkakkar committed Mar 23, 2024
1 parent d1d7988 commit 76c7409
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void configureBindings() {
PRIMARY_CONTROLLER.povRight().whileTrue(feedThroughCommand());

// DPAD left - PARTY BUTTON!!
PRIMARY_CONTROLLER.povLeft().whileTrue(partyButton());
PRIMARY_CONTROLLER.povLeft().whileTrue(partyMode());
}

/**
Expand Down Expand Up @@ -273,10 +273,10 @@ private Command aimAtObject() {
* PARTY BUTTON!!!!
* @return Command that spins the robot and moves the shooter up and down
*/
private Command partyButton() {
private Command partyMode() {
return Commands.parallel(
DRIVE_SUBSYSTEM.driveCommand(() -> 0.0, () -> 0.0, () -> 1.0),
SHOOTER_SUBSYSTEM.shootPartyButton()
SHOOTER_SUBSYSTEM.shootPartyMode()
);
}

Expand Down
16 changes: 6 additions & 10 deletions src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -575,18 +575,14 @@ public Command passCommand() {
* Move shooter up and down
* @return Command to move the shooter between upper and lower limits
*/
public Command shootPartyButton() {
public Command shootPartyMode() {
return run(() -> {
State top = new State(ZERO_FLYWHEEL_SPEED, Units.Degrees.of(m_angleConfig.getUpperLimit()));
State bottom = new State(ZERO_FLYWHEEL_SPEED, Units.Degrees.of(m_angleConfig.getLowerLimit()));
boolean currentTargetTop = true;
if (currentTargetTop)
setState(top);
else
State top = new State(ZERO_FLYWHEEL_SPEED, Units.Radians.of(m_angleConfig.getUpperLimit()));
State bottom = new State(ZERO_FLYWHEEL_SPEED, Units.Radians.of(m_angleConfig.getLowerLimit()));
if (isReady() && m_desiredShooterState == top)
setState(bottom);

if (isReady())
currentTargetTop = !currentTargetTop;
if (isReady() && m_desiredShooterState == bottom)
setState(top);
});
}

Expand Down

0 comments on commit 76c7409

Please sign in to comment.