Skip to content

Commit

Permalink
fix override
Browse files Browse the repository at this point in the history
  • Loading branch information
Anhysteretic committed Nov 21, 2024
1 parent 153f215 commit f8d7a4f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/main/java/com/team841/calliope/drive/BioDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -54,16 +44,14 @@ 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;
private double velocity_y = 0.0;
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 =
Expand All @@ -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);
Expand All @@ -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));
}
Expand Down

0 comments on commit f8d7a4f

Please sign in to comment.