Skip to content

Commit

Permalink
Shooter stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ohowe1 committed Feb 18, 2024
1 parent add8c1b commit 98b86d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ public class ShooterSubsystem extends SubsystemBase {
new TunableTelemetryPIDController("/shooter/pid", SHOOTER_PID_GAINS);
private final SimpleMotorFeedforward feedforward = SHOOTER_FF_GAINS.createFeedforward();

private final DoubleTelemetryEntry topFlyVoltageReq =
private final DoubleTelemetryEntry flyVoltageReq =
new DoubleTelemetryEntry("/shooter/topVoltage", false);
private final EventTelemetryEntry shooterEventEntry = new EventTelemetryEntry("/shooter/events");

public ShooterSubsystem() {
configMotor();
setDefaultCommand(setVoltageCommand(0.0));
}

public void configMotor() {
Expand Down Expand Up @@ -82,18 +83,17 @@ public void configMotor() {
flywheelMotorAlert.set(faultInitializing);
}

public void setFlyVoltage(double voltage) {
public void setVoltage(double voltage) {
flyVoltageReq.append(voltage);
flywheelMotor.setVoltage(voltage);
}

public void setRPM(double rpm) {
double forwardVol = feedforward.calculate(rpm);

setFlyVoltage(forwardVol);
public Command setVoltageCommand(double voltage) {
return this.run(() -> setVoltage(voltage));
}

public Command runRPMCommand(double RPM) {
return this.run(() -> this.setRPM(RPM));
public Command runVelocityCommand(double setpointRotationsPerSecond) {
return this.run(() -> setVoltage(pidController.calculate(flywheelEncoder.getVelocity(), setpointRotationsPerSecond) + feedforward.calculate(setpointRotationsPerSecond)));
}

@Override
Expand Down

0 comments on commit 98b86d2

Please sign in to comment.