Skip to content

Commit

Permalink
Merge branch '27-handoff-command' into ElevatorCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
GalexY727 authored Jan 24, 2024
2 parents 132bb47 + a3a6e5a commit 0d8f123
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/commands/ShooterCalc.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ public Command sendBackCommand() {

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

public void shooterSetSpeed(double speed) {
shooter.setSpeed(speed);
}

public void shooterStop() {
shooter.stop();
public Command shooterStopCommand() {
return shooter.stop();
}

public void pivotSetAngle(double angle) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/subsystems/shooter/Pivot.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public void configMotor() {
}

public void setAngle(double angle) {
// Divide by 180 because angle will be a value between 180 and -180
// and we want to set the position between 1.0 and -1.0
pivot.setTargetPosition(angle / ShooterConstants.PIVOT_MAX_ANGLE);
}
public void setRestAngle() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setSpeed(double speed) {
}

public Command stop() {
return Commands.run(() -> motorLeft.setTargetVelocity(0));
return Commands.runOnce(() -> motorLeft.setTargetVelocity(0));
}

//TODO: Implement a way to get the RPM of the shooter
Expand Down

0 comments on commit 0d8f123

Please sign in to comment.