From 4d106f3f196010dbd9e5870682d115f92d1703de Mon Sep 17 00:00:00 2001 From: Zach R Date: Sun, 4 Aug 2024 10:36:58 -0700 Subject: [PATCH] feat: add outtake and amp to demo 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' --- src/main/java/org/team1540/robot2024/RobotContainer.java | 8 +++++--- .../robot2024/commands/shooter/ShootSequence.java | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/team1540/robot2024/RobotContainer.java b/src/main/java/org/team1540/robot2024/RobotContainer.java index 14b5da59..a9d6e3ba 100644 --- a/src/main/java/org/team1540/robot2024/RobotContainer.java +++ b/src/main/java/org/team1540/robot2024/RobotContainer.java @@ -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 diff --git a/src/main/java/org/team1540/robot2024/commands/shooter/ShootSequence.java b/src/main/java/org/team1540/robot2024/commands/shooter/ShootSequence.java index 2e0bab12..66bdcbe5 100644 --- a/src/main/java/org/team1540/robot2024/commands/shooter/ShootSequence.java +++ b/src/main/java/org/team1540/robot2024/commands/shooter/ShootSequence.java @@ -23,14 +23,14 @@ public ShootSequence(Shooter shooter, Indexer indexer) { this(shooter, indexer, () -> HUB_SHOOT); } public ShootSequence(Shooter shooter, Indexer indexer, Supplier setpoint) { - this(shooter, indexer, setpoint, 1); + this(shooter, indexer, setpoint, 1, false); } - public ShootSequence(Shooter shooter, Indexer indexer, Supplier setpoint, double waitTime) { + public ShootSequence(Shooter shooter, Indexer indexer, Supplier 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?)