Skip to content

Commit

Permalink
Shooter Debug Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BrownGenius committed Feb 2, 2024
1 parent 64f7c06 commit 9d30ce9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import edu.wpi.first.math.controller.SimpleMotorFeedforward;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import org.littletonrobotics.junction.AutoLogOutput;
import org.littletonrobotics.junction.Logger;
Expand All @@ -13,6 +12,7 @@ public class ShooterSubsystem extends SubsystemBase implements Shooter {
private final ShooterIOInputsAutoLogged inputs = new ShooterIOInputsAutoLogged();
@AutoLogOutput private double voltage;
@AutoLogOutput private double velocityRPM;
@AutoLogOutput private double targetVelocityRadPerSec;

public ShooterSubsystem(ShooterIO io) {
this.io = io;
Expand All @@ -25,6 +25,7 @@ public ShooterSubsystem(ShooterIO io) {
@Override
// Disable the shooter
public void disable() {
targetVelocityRadPerSec = 0;
io.stop();
}

Expand All @@ -43,9 +44,9 @@ public void runVoltage(double volts) {
@Override
public void runVelocity(double velocityRPM) {
this.velocityRPM = velocityRPM;
var velocityRadPerSec = Units.rotationsPerMinuteToRadiansPerSecond(velocityRPM);
targetVelocityRadPerSec = Units.rotationsPerMinuteToRadiansPerSecond(velocityRPM);

io.setVelocity(velocityRadPerSec, ffModel.calculate(velocityRadPerSec));
io.setVelocity(targetVelocityRadPerSec, ffModel.calculate(targetVelocityRadPerSec));
}

@Override
Expand All @@ -63,7 +64,5 @@ public void periodic() {
// Updates the inputs
io.updateInputs(inputs);
Logger.processInputs("Shooter", inputs);
SmartDashboard.putNumber("Shooter/TopRPM", inputs.velocityRadPerSecTop);
SmartDashboard.putNumber("Shooter/BottomRPM", inputs.velocityRadPerSecBottom);
}
}

0 comments on commit 9d30ce9

Please sign in to comment.