Skip to content

Commit

Permalink
Modify Sim Support
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Mar 27, 2024
1 parent bf5a4e4 commit b5f8789
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class ShooterSubsystem extends SubsystemBase {
private double m_topSpeed = 0;
private double m_bottomSpeed = 0;

private double m_simRPM = 0;

public ShooterSubsystem() {
m_bottom.setIdleMode(IdleMode.kCoast);
m_top.setIdleMode(IdleMode.kCoast);
Expand Down Expand Up @@ -59,7 +61,9 @@ public void setShootingSpeed(ShootSpeed speed) {
}

public double returnCurrentSpeed() {
return Robot.isReal() ? m_bottom.getEncoder().getVelocity() : (m_topSpeed > 0.5) ? 4000 : 0;
if (m_topSpeed > 0.5 && m_simRPM < 15) m_simRPM++;
else if (m_simRPM > 0) m_simRPM--;
return Robot.isReal() ? m_bottom.getEncoder().getVelocity() : m_simRPM * 400;
}

@Override
Expand Down

0 comments on commit b5f8789

Please sign in to comment.