shotBlocker in code - #258
Conversation
There was a problem hiding this comment.
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.
| 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())); |
There was a problem hiding this comment.
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()));
}|
seems like mech is doing this so keeping this here just in case |
No description provided.