Skip to content

Commit

Permalink
End of season
Browse files Browse the repository at this point in the history
  • Loading branch information
Anhysteretic committed Nov 11, 2024
1 parent b0557ec commit d39ae30
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
8 changes: 7 additions & 1 deletion src/main/deploy/pathplanner/autos/Blue - D_54.auto
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"version": 1.0,
"startingPose": null,
"startingPose": {
"position": {
"x": 1.53,
"y": 3.33
},
"rotation": 180.0
},
"command": {
"type": "sequential",
"data": {
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/team841/calliope/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ public RobotContainer() {
() -> -sticksPS5[0].getLeftX() * Swerve.MaxSpeed,
() -> -sticksPS5[0].getRightX() * Swerve.MaxAngularRate,
() -> sticksPS5[0].L2().getAsBoolean(),
() -> sticksXbox[0].rightBumper().getAsBoolean(),
() -> -sticksXbox[0].getRightX() * 2 * Math.PI);
() -> -sticksXbox[0].getLeftX());



Expand Down Expand Up @@ -317,6 +316,10 @@ private void configureDuoStick() {
.a()
.onTrue(new InstantCommand(shooter::trapShot))
.onFalse(new InstantCommand(shooter::stopShooter));

sticksXbox[0].rightBumper()
.whileTrue(new InstantCommand(shooter::flyShot2))
.onFalse(new InstantCommand(shooter::stopShooter));
}

private void registerNamedCommands(){
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/com/team841/calliope/drive/BioDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ public class BioDrive extends Command {
*/

public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSupplier velocityYGetter, DoubleSupplier velocityOmegaGetter, BooleanSupplier faceSpeakerGetter, BooleanSupplier overRideTurn, DoubleSupplier overrideVelocity) {
public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSupplier velocityYGetter, DoubleSupplier velocityOmegaGetter, BooleanSupplier faceSpeakerGetter, DoubleSupplier overrideVelocity) {

this(drivetrain, velocityXGetter, velocityYGetter, velocityOmegaGetter, faceSpeakerGetter);

this.Override = overRideTurn;
this.vOverride = overrideVelocity;

}
Expand Down Expand Up @@ -56,14 +55,13 @@ public BioDrive(Drivetrain drivetrain, DoubleSupplier velocityXGetter, DoubleSup
private Command shootCommand;

private DoubleSupplier mVelocityX, mVelocityY, mVelocityOmega, vOverride;
private BooleanSupplier mFaceSpeaker, mAutoShoot, Override;
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 boolean overRide = false;
private double overrideVelocity = 0.0;

private Drivetrain drivetrain;
Expand Down Expand Up @@ -92,7 +90,6 @@ public void execute() {
this.velocity_y = mVelocityY.getAsDouble();
this.velocity_omega = mVelocityOmega.getAsDouble();
//this.autoShoot = mAutoShoot.getAsBoolean();
this.overRide = Override.getAsBoolean();
this.overrideVelocity = vOverride.getAsDouble();

Logger.recordOutput("BioDrive/FaceSpeaker", this.faceSpeaker);
Expand All @@ -110,8 +107,8 @@ public void execute() {
this.drivetrain.setControl(fieldCentricFacingAngle.withVelocityX(-this.velocity_x).withVelocityY(-this.velocity_y).withTargetDirection(angle));
*/
} else if (overRide) {
this.drivetrain.setControl(fieldCentricDrive.withVelocityX(-this.velocity_x).withVelocityY(-this.velocity_y).withRotationalRate(this.overrideVelocity));
} 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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public void flyShot() {
io.setMotionMagicVelocityVoltageOutput(70);
}

public void flyShot2() {io.setMotionMagicVelocityVoltageOutput(50);}

public void disruptshot() {
io.setMotionMagicVelocityVoltageOutput(12.5);
}
Expand Down

0 comments on commit d39ae30

Please sign in to comment.