speed in auto

check fo rspeed in auto
This commit is contained in:
SHikhar
2026-02-27 20:02:12 -07:00
parent e299d3bd0a
commit 3b5ff2a252
3 changed files with 30 additions and 22 deletions
@@ -29,6 +29,7 @@ public class Shooter extends SubsystemBase {
// Supplier<Pose2d> m_swervePoseSupplier;
public boolean badShooterVelocity;
public Shooter(
@@ -75,6 +76,7 @@ public class Shooter extends SubsystemBase {
}
public void allowShooting() {
shooterButtonReady = true;
}
@@ -89,6 +91,12 @@ public class Shooter extends SubsystemBase {
return mode;
}
@AutoLogOutput
public boolean isShooterUpToSpeed() {
return !badShooterVelocity;
}
@Override
public void periodic() {
@@ -132,7 +140,8 @@ public class Shooter extends SubsystemBase {
double shooterSpeed = Math.abs(state.motor1Velocity.in(RotationsPerSecond) + state.motor2Velocity.in(RotationsPerSecond)) / 2;
double shooterSpeedTarget = Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond) + state.motor2TargetVelocity.in(RotationsPerSecond)) / 2;
boolean badShooterVelocity = Math.abs(shooterSpeed - shooterSpeedTarget) > ShooterConstants.SHOOTER_SPEED_TOLERANCE.get();
badShooterVelocity = Math.abs(shooterSpeed - shooterSpeedTarget) > ShooterConstants.SHOOTER_SPEED_TOLERANCE.get();
switch (mode) {
case Shooting: