Skip to content

Commit

Permalink
chore: sent shotoeriems to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Mar 10, 2024
1 parent 0c7a77c commit 28c89b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public static final class ShooterConstants {
public static final double kShooterSpeedTop = 0.8;
public static final double kShooterSpeedBottom = 0.9;
public static final double kShooterOff = 0;

public static final double kShooterOffTime = 0.04;
public static final double kShooterOnTime = 1.5;
}

public static class ClimberConstants {
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.Constants.DriveConstants;
import frc.robot.Constants.IOConstants;
import frc.robot.Constants.ShooterConstants;
import frc.robot.commands.IntakeArmPositionCommand;
import frc.robot.commands.NoteIntakeCommand;
import frc.robot.commands.NoteOuttakeCommand;
Expand Down Expand Up @@ -63,9 +64,9 @@ public class RobotContainer {
public RobotContainer() {
NamedCommands.registerCommand("Shoot",
new SequentialCommandGroup(
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, 1.5),
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime),
new ParallelDeadlineGroup(new WaitCommand(1), new NoteOuttakeCommand(m_intakeSubsystem)),
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, 0.01)));
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)));

NamedCommands.registerCommand("Intake",
new SequentialCommandGroup(
Expand Down Expand Up @@ -159,9 +160,9 @@ private void configureBindings() {
// DriveConstants.kMaxAngularSpeedRadiansPerSecond - 1, 5)));

new JoystickButton(m_driverController, Button.kX.value)
.onTrue(new SequentialCommandGroup(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, 1.5),
.onTrue(new SequentialCommandGroup(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime),
new NoteOuttakeCommand(m_intakeSubsystem)))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, 0.3));
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime));

new JoystickButton(m_driverController, Button.kRightBumper.value)
.onTrue(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Amp))
Expand All @@ -184,8 +185,8 @@ private void configureBindings() {

new Trigger(() -> {
return m_operatorController.getLeftTriggerAxis() > 0.5;
}).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, 1.5))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, 0.04));
}).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime));

// Climber Up, Operator Controller Right Bumper + A Button
new Trigger(() -> {
Expand Down

0 comments on commit 28c89b4

Please sign in to comment.