Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit b1dc55f

Browse files
authored
shooter quick fix (#79)
1 parent d157be2 commit b1dc55f

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public RobotContainer() {
4444

4545
private void configureBindings() {
4646
m_driverController.btn_LeftTrigger.whileTrue(com_IntakeGround);
47-
m_driverController.btn_A.whileTrue(com_PrepShooter);
47+
m_driverController.btn_A.onTrue(com_PrepShooter);
4848
m_driverController.btn_B.whileTrue(com_IntakeHopper);
4949
m_driverController.btn_LeftBumper.whileTrue(com_EjectShooter);
5050
m_driverController.btn_RightTrigger.onTrue(com_Shoot);

src/main/java/frc/robot/commands/HasGP.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@
55
package frc.robot.commands;
66

77
import edu.wpi.first.wpilibj2.command.Command;
8+
import frc.robot.subsystems.Shooter;
89
import frc.robot.subsystems.Stager;
910

1011
public class HasGP extends Command {
1112
/** Creates a new StageGP. */
1213
Stager globalStager;
14+
Shooter globalShooter;
1315

14-
public HasGP(Stager passedStager) {
16+
public HasGP(Stager passedStager, Shooter passedShooter) {
1517
// Use addRequirements() here to declare subsystem dependencies.
1618
globalStager = passedStager;
19+
globalShooter = passedShooter;
1720
}
1821

1922
// Called when the command is initially scheduled.
2023
@Override
2124
public void initialize() {
22-
25+
globalShooter.setShooterNuetralOutput();
2326
}
2427

2528
// Called every time the scheduler runs while the command is scheduled.

src/main/java/frc/robot/commands/PrepShooter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public void execute() {
3232
// Called once the command ends or is interrupted.
3333
@Override
3434
public void end(boolean interrupted) {
35-
globalShooter.setShooterNuetralOutput();
3635
}
3736

3837
// Returns true when the command should end.

src/main/java/frc/robot/commands/Shoot.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public Shoot(Stager passedStager, Shooter passedShooter) {
2323
// Called when the command is initially scheduled.
2424
@Override
2525
public void initialize() {
26+
globalShooter.setPropelMotorVelocity(Constants.constShooter.PROPEL_MOTOR_VELOCITY);
27+
globalShooter.setSpiralMotorVelocity(Constants.constShooter.SPIRAL_MOTOR_VELOCITY);
2628
if ((globalShooter.getPropelMotorVelocity() >= Constants.constShooter.PROPEL_MOTOR_VELOCITY)
2729
&& (globalShooter.getSpiralMotorVelocity() >= Constants.constShooter.SPIRAL_MOTOR_VELOCITY)) {
2830
globalStager.setStagerMotorVelocity(Constants.constStager.STAGER_MOTOR_VELOCITY);
@@ -42,6 +44,7 @@ public void execute() {
4244
@Override
4345
public void end(boolean interrupted) {
4446
globalStager.setStagerMotorVelocityNuetralOutput();
47+
globalShooter.setShooterNuetralOutput();
4548
}
4649

4750
// Returns true when the command should end.

0 commit comments

Comments
 (0)