Skip to content

shotBlocker in code - #258

Draft
cwkpete7383 wants to merge 3 commits into
Issue250from
drumBlock
Draft

shotBlocker in code#258
cwkpete7383 wants to merge 3 commits into
Issue250from
drumBlock

Conversation

@cwkpete7383

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Blocker subsystem, including its hardware configuration, initialization logic, and integration into the robot's control scheme via a new BLOCK intake mode. The review feedback identifies a potential NullPointerException in Controls.java when the blocker is disabled, incorrect position constants in Blocker.java that would prevent physical movement, and a recommendation to use instance-based command factories for more robust subsystem requirement handling.

Comment on lines +432 to +440
connected(indexingTestController)
.and(indexingTestController.rightTrigger())
.onTrue(
Commands.parallel(
Commands.runOnce(() -> intakeMode = IntakeMode.BLOCK),
s.blocker.blockerOutCommand()))
.onFalse(
Commands.parallel(
Commands.runOnce(() -> updateIntakeMode()), s.blocker.blockerInCommand()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This trigger binding should be guarded with a null check for s.blocker. If the blocker subsystem is disabled in Subsystems.java, s.blocker will be null, leading to a NullPointerException when blockerOutCommand() or blockerInCommand() is called.

    if (s.blocker != null) {
      connected(indexingTestController)
          .and(indexingTestController.rightTrigger())
          .onTrue(
              Commands.parallel(
                  Commands.runOnce(() -> intakeMode = IntakeMode.BLOCK),
                  s.blocker.blockerOutCommand()))
          .onFalse(
              Commands.parallel(
                  Commands.runOnce(() -> updateIntakeMode()), s.blocker.blockerInCommand()));
    }

Comment thread src/main/java/frc/robot/subsystems/Blocker.java
Comment thread src/main/java/frc/robot/subsystems/Blocker.java
@koolpoolo koolpoolo reopened this Jun 2, 2026
@koolpoolo
koolpoolo marked this pull request as draft June 2, 2026 00:02
@koolpoolo

Copy link
Copy Markdown
Contributor

seems like mech is doing this so keeping this here just in case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants