mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
speed in auto
check fo rspeed in auto
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user