Skip to content

Commit

Permalink
feat: add outtake and amp to demo
Browse files Browse the repository at this point in the history
Update at 'Sun Aug 04 10:38:35 PDT 2024'

Update at 'Sun Aug 04 10:40:20 PDT 2024'

Update at 'Sun Aug 04 10:40:41 PDT 2024'

Update at 'Sun Aug 04 10:56:01 PDT 2024'
  • Loading branch information
rutmanz committed Aug 4, 2024
1 parent d16a380 commit 4d106f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/main/java/org/team1540/robot2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,13 @@ private void configureButtonBindings() {
driver.leftBumper().toggleOnTrue(overstageTargetDrive);

kidPilot.leftBumper().or(kidPilot.leftTrigger()).whileTrue(new ContinuousIntakeCommand(indexer, leds, 1));
kidPilot.rightBumper().or(kidPilot.rightTrigger()).whileTrue(new ContinuousIntakeCommand(indexer, leds, -1));

LoggedTunableNumber kidAngleSetpoint = new LoggedTunableNumber("kidMode/shooter/angle", HUB_SHOOT.pivot.getDegrees());
LoggedTunableNumber kidLeftSetpoint = new LoggedTunableNumber("kidMode/shooter/left", 2000);
LoggedTunableNumber kidRightSetpoint = new LoggedTunableNumber("kidMode/shooter/right", 2000);
kidPilot.rightBumper().or(kidPilot.rightTrigger()).whileTrue(new ShootSequence(shooter, indexer, () -> new ShooterSetpoint(Rotation2d.fromDegrees(kidAngleSetpoint.get()), kidLeftSetpoint.get(), kidRightSetpoint.get())));
LoggedTunableNumber kidLeftSetpoint = new LoggedTunableNumber("kidMode/shooter/left", 1500);
LoggedTunableNumber kidRightSetpoint = new LoggedTunableNumber("kidMode/shooter/right", 1500);
kidPilot.x().whileTrue(new ShootSequence(shooter, indexer, () -> new ShooterSetpoint(Rotation2d.fromDegrees(kidAngleSetpoint.get()), kidLeftSetpoint.get(), kidRightSetpoint.get()), 0.5, true));
kidPilot.a().whileTrue(new AmpScoreSequence(tramp, indexer, elevator));
kidPilot.start().and(kidPilot.back()).onTrue(Commands.runOnce(drivetrain::zeroFieldOrientationManual));

// TODO remove this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public ShootSequence(Shooter shooter, Indexer indexer) {
this(shooter, indexer, () -> HUB_SHOOT);
}
public ShootSequence(Shooter shooter, Indexer indexer, Supplier<ShooterSetpoint> setpoint) {
this(shooter, indexer, setpoint, 1);
this(shooter, indexer, setpoint, 1, false);
}
public ShootSequence(Shooter shooter, Indexer indexer, Supplier<ShooterSetpoint> setpoint, double waitTime) {
public ShootSequence(Shooter shooter, Indexer indexer, Supplier<ShooterSetpoint> setpoint, double waitTime, boolean longTimeout) {
addCommands(
new PrepareShooterCommand(shooter, setpoint),
Commands.sequence(
Commands.waitSeconds(waitTime),
IntakeAndFeed.withDefaults(indexer).withTimeout(0.5)
IntakeAndFeed.withDefaults(indexer).withTimeout(longTimeout ? 15 : 0.5)
)

// TODO: Add a wait for having completed the shot (steady then current spike/velocity dip and then back down?)
Expand Down

0 comments on commit 4d106f3

Please sign in to comment.