From f8d7a4fba22d55003c4565782747f219ea56863c Mon Sep 17 00:00:00 2001 From: David Tian Date: Wed, 20 Nov 2024 18:34:04 -0800 Subject: [PATCH] fix override --- .../com/team841/calliope/drive/BioDrive.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/main/java/com/team841/calliope/drive/BioDrive.java b/src/main/java/com/team841/calliope/drive/BioDrive.java index d09883d..78af63b 100644 --- a/src/main/java/com/team841/calliope/drive/BioDrive.java +++ b/src/main/java/com/team841/calliope/drive/BioDrive.java @@ -23,16 +23,6 @@ public class BioDrive extends Command { } */ - - public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSupplier velocityYGetter, DoubleSupplier velocityOmegaGetter, BooleanSupplier faceSpeakerGetter, DoubleSupplier overrideVelocity) { - - this(drivetrain, velocityXGetter, velocityYGetter, velocityOmegaGetter, faceSpeakerGetter); - - this.vOverride = overrideVelocity; - - } - - public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSupplier velocityYGetter, DoubleSupplier velocityOmegaGetter, BooleanSupplier faceSpeakerGetter) { this.drivetrain = drivetrain; @@ -54,7 +44,7 @@ public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSup private Command shootCommand; - private DoubleSupplier mVelocityX, mVelocityY, mVelocityOmega, vOverride; + private DoubleSupplier mVelocityX, mVelocityY, mVelocityOmega; private BooleanSupplier mFaceSpeaker, mAutoShoot; private boolean faceSpeaker = false; @@ -62,8 +52,6 @@ public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSup private double velocity_x = 0.0; private double velocity_omega = 0.0; private boolean autoShoot = false; - private double overrideVelocity = 0.0; - private Drivetrain drivetrain; private final SwerveRequest.FieldCentric fieldCentricDrive = @@ -90,7 +78,6 @@ public void execute() { this.velocity_y = mVelocityY.getAsDouble(); this.velocity_omega = mVelocityOmega.getAsDouble(); //this.autoShoot = mAutoShoot.getAsBoolean(); - this.overrideVelocity = vOverride.getAsDouble(); Logger.recordOutput("BioDrive/FaceSpeaker", this.faceSpeaker); Logger.recordOutput("BioDrive/velocityX", this.velocity_x); @@ -107,8 +94,6 @@ public void execute() { this.drivetrain.setControl(fieldCentricFacingAngle.withVelocityX(-this.velocity_x).withVelocityY(-this.velocity_y).withTargetDirection(angle)); */ - } else if (Math.abs(overrideVelocity) > 0.15) { - this.drivetrain.setControl(fieldCentricDrive.withVelocityX(-this.velocity_x).withVelocityY(-this.velocity_y).withRotationalRate(-this.overrideVelocity * 2 * Math.PI)); } else { this.drivetrain.setControl(fieldCentricDrive.withVelocityX(-this.velocity_x).withVelocityY(-this.velocity_y).withRotationalRate(this.velocity_omega)); }