Skip to content

Commit

Permalink
feat: autos enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
WeilSimon committed Sep 27, 2024
1 parent 89b2806 commit d784c8c
Show file tree
Hide file tree
Showing 10 changed files with 7,148 additions and 7,135 deletions.
4,828 changes: 2,414 additions & 2,414 deletions paths.chor

Large diffs are not rendered by default.

1,836 changes: 918 additions & 918 deletions src/main/deploy/choreo/WeirdSourceLanePHGF.1.traj

Large diffs are not rendered by default.

1,806 changes: 903 additions & 903 deletions src/main/deploy/choreo/WeirdSourceLanePHGF.2.traj

Large diffs are not rendered by default.

946 changes: 473 additions & 473 deletions src/main/deploy/choreo/WeirdSourceLanePHGF.3.traj

Large diffs are not rendered by default.

4,804 changes: 2,402 additions & 2,402 deletions src/main/deploy/choreo/WeirdSourceLanePHGF.traj

Large diffs are not rendered by default.

48 changes: 27 additions & 21 deletions src/main/java/org/team1540/robot2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,16 @@ private void configureButtonBindings() {
// driver.leftTrigger().whileTrue(
// new DriveWithCorrectionCommand(drivetrain, driver, ()->-noteVision.getLatestDetection().rotation().toRotation2d().getDegrees())
// );
driver.leftTrigger().whileTrue(
new DriveWithCorrectionCommand2(drivetrain, driver, ()->-noteVision.getLatestDetection().rotation().toRotation2d().getDegrees())
);

}
driver.rightTrigger().whileTrue(
new DriveWithCorrectionCommand2(drivetrain, driver, ()->-noteVision.getLatestDetection().rotation().toRotation2d().getDegrees())
);


// driver.povDown().and(() -> !DriverStation.isFMSAttached()).onTrue(Commands.runOnce(() -> drivetrain.setPose(new Pose2d(Units.inchesToMeters(260), Units.inchesToMeters(161.62), Rotation2d.fromRadians(0)))).ignoringDisable(true));

driver.rightTrigger(0.95).toggleOnTrue(counterShuffleDrive);
driver.leftTrigger(0.95).toggleOnTrue(counterShuffleDrive);

driver.rightStick().onTrue(cancelAlignment);

Expand Down Expand Up @@ -336,40 +337,45 @@ private void configureAutoRoutines() {
)
);

autos.add(new AutoCommand("WheelRadiusChar", new WheelRadiusCharacterization(drivetrain, WheelRadiusCharacterization.Direction.COUNTER_CLOCKWISE)));

}
autos.add(new AutoCommand("WheelRadiusChar", new WheelRadiusCharacterization(drivetrain, WheelRadiusCharacterization.Direction.COUNTER_CLOCKWISE)));
autos.addDefault(new AutoCommand("Dwayne :skull:"));
autos.add(new AutoCommand("Subwoofer Shot", ShootSequence.forAutoSubwoofer(shooter, indexer)));
// autos.addDefault(new ATestAuto(drivetrain, shooter, indexer));
// autos.add(new AmpLanePADEF(drivetrain, shooter, indexer));
// autos.add(new AmpLanePAEDF(drivetrain, shooter, indexer));
// autos.add(new AmpLanePAEDSprint(drivetrain, shooter, indexer));
autos.add(new AmpLanePADESprint(drivetrain, shooter, indexer));
autos.add(new AmpLanePAEDSprint(drivetrain, shooter, indexer));
autos.add(new AmpLanePADEF(drivetrain, shooter, indexer));
autos.add(new AmpLanePAEDF(drivetrain, shooter, indexer));
//// autos.add(new AutoCommand("SubwooferShot", new ShootSequence(shooter, indexer)));
//// autos.add(new DriveSinglePath("Taxi", drivetrain));
//// autos.add(new DriveSinglePath("Sprint", drivetrain));
//// autos.add(new DriveSinglePath("CenterLaneSprint", drivetrain, true, true));
//// autos.add(new AmpLanePADESprint(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePSubSprint(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePCBADSprint(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAFSprint(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAFE(drivetrain, shooter, indexer));
// autos.add(new CenterLanePDEABC(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAFG(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAEF(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAGF(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBA(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBFSprint(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBAFSprint(drivetrain, shooter, indexer));
autos.add(new CenterLanePBFCA(drivetrain, shooter, indexer));
autos.add(new CenterLanePDEABC(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBAEF(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBAFE(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBAGF(drivetrain, shooter, indexer));
autos.add(new CenterLanePCBAFG(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBADE(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBAED(drivetrain, shooter, indexer));
// autos.add(new CenterLanePCBA(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePCBA(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePBDA(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePSubCSubBSubASubFSub(drivetrain, shooter, indexer));
////// autos.add(new CenterLanePSubCSubBSubFSub(drivetrain, shooter, indexer));
//// autos.add(new CenterLanePSubCSubBSubASub(drivetrain, shooter, indexer));
// autos.add(new SourceLanePHGF(drivetrain, shooter, indexer));
// autos.add(new SourceLanePGHSprint(drivetrain, shooter, indexer));
// autos.add(new SourceLanePGFE(drivetrain, shooter, indexer));
// autos.add(new SourceLanePGFH(drivetrain, shooter, indexer));
autos.add(new SourceLanePGHSprint(drivetrain, shooter, indexer));
autos.add(new SourceLanePHGF(drivetrain, shooter, indexer));
autos.add(new SourceLanePGFE(drivetrain, shooter, indexer));
autos.add(new SourceLanePGFH(drivetrain, shooter, indexer));
autos.add(new SourceLaneCBASprint(drivetrain, shooter, indexer));
autos.add(new WeirdSourceLanePHGF(drivetrain, shooter, indexer));
//// autos.addDefault(new ATestAuto(drivetrain, shooter, indexer));
// autos.add(new AutoCommand("Subwoofer Shot", ShootSequence.forAutoSubwoofer(shooter, indexer)));
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.team1540.robot2024.commands.autos;

import org.team1540.robot2024.commands.shooter.ShootSequence;
import org.team1540.robot2024.util.auto.AutoCommand;
import org.team1540.robot2024.subsystems.drive.Drivetrain;
import org.team1540.robot2024.subsystems.shooter.Shooter;
Expand All @@ -19,6 +20,7 @@ public CenterLanePBFCA(Drivetrain drivetrain, Shooter shooter, Indexer indexer)
PathHelper.fromChoreoPath("CenterLanePBFCA.4")
);
addCommands(
ShootSequence.forAutoSubwoofer(shooter, indexer),
Commands.parallel(
new LeadingShootPrepare(drivetrain, shooter),
Commands.sequence(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public SourceLaneCBASprint(Drivetrain drivetrain, Shooter shooter, Indexer index
createSegmentSequence(drivetrain, shooter, indexer, 1),
createSegmentSequence(drivetrain, shooter, indexer, 2),
createSegmentSequence(drivetrain, shooter, indexer, 3),
createSegmentSequence(drivetrain, shooter, indexer, 4)
getPath(4).getCommand(drivetrain)
)
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.team1540.robot2024.commands.autos;

import org.team1540.robot2024.Constants;
import org.team1540.robot2024.commands.shooter.DefaultShooterCommand;
import org.team1540.robot2024.commands.shooter.SpitShoot;
import org.team1540.robot2024.util.auto.AutoCommand;
import org.team1540.robot2024.subsystems.drive.Drivetrain;
import org.team1540.robot2024.subsystems.shooter.Shooter;
Expand All @@ -18,6 +21,7 @@ public WeirdSourceLanePHGF(Drivetrain drivetrain, Shooter shooter, Indexer index
PathHelper.fromChoreoPath("WeirdSourceLanePHGF.3")
);
addCommands(
new SpitShoot(shooter, indexer, Constants.Shooter.Flywheels.LEFT_RPM, Constants.Shooter.Flywheels.RIGHT_RPM, 1, 1, 0.25),
Commands.parallel(
new LeadingShootPrepare(drivetrain, shooter),
Commands.sequence(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import org.team1540.robot2024.Constants;
import org.team1540.robot2024.commands.indexer.IntakeAndFeed;
Expand All @@ -13,14 +14,14 @@
import java.util.function.Supplier;

public class SpitShoot extends ParallelCommandGroup {
public SpitShoot(Shooter shooter, Indexer indexer, double leftSetpoint, double rightSetpoint, double indexerPercent, double feederPercent) {
public SpitShoot(Shooter shooter, Indexer indexer, double leftSetpoint, double rightSetpoint, double indexerPercent, double feederPercent, double waitSeconds) {
addCommands(
new IntakeAndFeed(indexer, ()->indexerPercent, ()->feederPercent),
Commands.waitSeconds(waitSeconds).andThen(new IntakeAndFeed(indexer, ()->indexerPercent, ()->feederPercent)),
new PrepareShooterCommand(shooter, ()-> new ShooterSetpoint(0, leftSetpoint, rightSetpoint))
);
}

public SpitShoot(Shooter shooter, Indexer indexer){
this(shooter, indexer, Constants.Shooter.Flywheels.LEFT_RPM, Constants.Shooter.Flywheels.RIGHT_RPM, 1, 1);
this(shooter, indexer, Constants.Shooter.Flywheels.LEFT_RPM, Constants.Shooter.Flywheels.RIGHT_RPM, 1, 1, 0);
}
}

0 comments on commit d784c8c

Please sign in to comment.