diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 3096e28..396a373 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -10,6 +10,9 @@ import frc.robot.commands.SetShooter; import frc.robot.subsystems.ArnavIntake.IntakeStates; import frc.robot.subsystems.ArnavShooter.ShooterStates; +import frc.robot.subsystems.ArnavIndexer; +import frc.robot.subsystems.ArnavIntake; +import frc.robot.subsystems.ArnavShooter; // import frc.robot.commands.Autos; // import frc.robot.commands.ExampleCommand; // import frc.robot.commands.TeleopSwerve; @@ -30,6 +33,9 @@ public class RobotContainer { private final Swerve s_Swerve = Swerve.getInstance(); //private final IntakeShooter s_IntakeShooter = IntakeShooter.getInstance(); //private final Pivot s_Pivot = Pivot.getInstance(); + private final ArnavIndexer s_ArnavIndexer = ArnavIndexer.getInstance(); + private final ArnavIntake s_ArnavIntake = ArnavIntake.getInstance(); + private final ArnavShooter s_ArnavShooter = ArnavShooter.getInstance(); private final XboxController driver = new XboxController(0); private final XboxController operator = new XboxController(1); @@ -119,7 +125,7 @@ private void configureBindings() { // driverY.whileTrue(s_Swerve.sysIdDynamic(SysIdRoutine.Direction.kReverse)); // shooter - operatorDpadUp.onTrue(maxShooter()); + operatorDpadUp.onTrue(new InstantCommand(() -> s_ArnavIndexer.setSpeed(0.5))); // An instant command just for testing right now operatorDpadDown.onTrue(offShooter()); operatorDpadRight.whileTrue(increaseShooter()); operatorDpadLeft.whileTrue(decreaseShooter()); @@ -141,6 +147,7 @@ private void configureBindings() { * @return the command to run in autonomous */ + //shooter public Command maxShooter() { return new SetShooter(ShooterStates.MAX); diff --git a/src/main/java/frc/robot/commands/SetShooter.java b/src/main/java/frc/robot/commands/SetShooter.java index d657625..031f8e7 100644 --- a/src/main/java/frc/robot/commands/SetShooter.java +++ b/src/main/java/frc/robot/commands/SetShooter.java @@ -7,21 +7,21 @@ public class SetShooter extends Command { private final ArnavShooter s_ArnavShooter; - double finalspeed; + double finalSpeed; public SetShooter(ArnavShooter.ShooterStates state) { //change from off or max speed s_ArnavShooter = ArnavShooter.getInstance(); - finalspeed = state.getValue(); + finalSpeed = state.getValue(); addRequirements(s_ArnavShooter); } public SetShooter(double difference) { //increase or decrease speed. Makes sure not to increase above max or decrease below 0 s_ArnavShooter = ArnavShooter.getInstance(); - double addedspeed = s_ArnavShooter.getspeed() + difference; + double addedSpeed = s_ArnavShooter.getSpeed() + difference; - if(addedspeed <= 1 && addedspeed >= 0) { - finalspeed = addedspeed; + if(addedSpeed <= 1 && addedSpeed >= 0) { + finalSpeed = addedSpeed; } addRequirements(s_ArnavShooter); @@ -34,7 +34,7 @@ public void initialize() { @Override public void execute() { - s_ArnavShooter.setspeed(finalspeed); + s_ArnavShooter.setSpeed(finalSpeed); } @Override diff --git a/src/main/java/frc/robot/subsystems/ArnavIndexer.java b/src/main/java/frc/robot/subsystems/ArnavIndexer.java index ef6e015..528a860 100644 --- a/src/main/java/frc/robot/subsystems/ArnavIndexer.java +++ b/src/main/java/frc/robot/subsystems/ArnavIndexer.java @@ -52,6 +52,9 @@ public void setSpeed(IndexerStates state) { this.state = state.name(); } + public void setSpeed(double speed) { + indexerM.set(speed); + } @Override public void periodic() { diff --git a/src/main/java/frc/robot/subsystems/ArnavShooter.java b/src/main/java/frc/robot/subsystems/ArnavShooter.java index 60dfd15..bfe9c7a 100644 --- a/src/main/java/frc/robot/subsystems/ArnavShooter.java +++ b/src/main/java/frc/robot/subsystems/ArnavShooter.java @@ -54,17 +54,17 @@ public double getValue() { } - public void setspeed(ShooterStates state) { //change state + public void setSpeed(ShooterStates state) { //change state shooterLeaderM.set(state.speed); currentSpeed = state.getValue(); } - public void setspeed(double newspeed) { //change specific speed - shooterFollowerM.set(newspeed); - currentSpeed = newspeed; + public void setSpeed(double newSpeed) { //change specific Speed + shooterLeaderM.set(newSpeed); + currentSpeed = newSpeed; } - public double getspeed() { //gets specific speed (i hope) + public double getSpeed() { //gets specific Speed (i hope) return currentSpeed; }