Skip to content

Commit

Permalink
added stopAiming and resetShooter
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-Cushman committed Jan 24, 2024
1 parent 3940508 commit 31f168a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/frc/robot/commands/ShooterCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public Command sendBackCommand() {
.andThen(() -> shooterSetSpeed(ShooterConstants.SHOOTER_BACK_SPEED));
}

public Command resetShooter() {
return Commands.runOnce(() -> stopAiming())
.andThen(Commands.runOnce(() -> shooterStop()))
.alongWith(Commands.runOnce(() -> pivotSetRestAngle()));
}

public void shooterSetSpeed(double speed) {
shooter.setSpeed(speed);
}
Expand All @@ -126,6 +132,10 @@ private void toggleAiming() {
this.aiming = (() -> !aiming.getAsBoolean());
}

private void stopAiming() {
this.aiming = (() -> false);
}

// Gets a SpeedAnglePair by interpolating values from a map of already
// known required speeds and angles for certain poses
private SpeedAnglePair calculateSpeed(Pose2d robotPose, boolean shootingAtSpeaker) {
Expand Down

0 comments on commit 31f168a

Please sign in to comment.