Skip to content

Fix Align Encoders trigger silently doing nothing - #194

Merged
nlaverdure merged 1 commit into
mainfrom
fix-align-encoders-trigger
Aug 4, 2026
Merged

Fix Align Encoders trigger silently doing nothing#194
nlaverdure merged 1 commit into
mainfrom
fix-align-encoders-trigger

Conversation

@nlaverdure

@nlaverdure nlaverdure commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Move the Triggers/Align Encoders NT trigger from Robot.java into Drive.java, requiring the Drive subsystem and resetting the boolean back to false after zeroing, matching Biocore's implementation.
  • Fix the actual root cause: ControllerSelector.scan() called CommandScheduler.getInstance().getDefaultButtonLoop().clear() to rebind controller controls, which silently wiped out any Trigger registered on that shared default loop before ControllerSelector ran — including Align Encoders. ControllerSelector now owns a private EventLoop for its own bindings, polled explicitly from robotPeriodic(), so re-scanning never touches Triggers registered elsewhere. Ported from Biocore commit 0b07ed7.

Test plan

  • ./gradlew compileJava compileTestJava passes clean
  • Deploy to the robot and confirm toggling Triggers/Align Encoders to true in Glass actually zeros the swerve encoders and the boolean pops back to false
  • Confirm driver/operator controller bindings (Zorro, Xbox driver, keyboard, Xbox operator) still fire normally after a controller reconnect/rescan

🤖 Generated with Claude Code

…dings

Move the "Triggers/Align Encoders" NT trigger into Drive itself, requiring
the Drive subsystem and resetting the boolean back to false once the
encoders are zeroed, matching Biocore.

Root cause of it silently doing nothing: ControllerSelector.scan() cleared
the CommandScheduler's shared default button loop to rebind controls on
every rescan, which wiped out any other Trigger (like Align Encoders)
registered on that same shared loop. ControllerSelector now owns a private
EventLoop for its own bindings, polled explicitly from robotPeriodic(), so
rescanning never touches Triggers registered elsewhere. Ported from
Biocore commit 0b07ed7.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nlaverdure
nlaverdure merged commit 126b37f into main Aug 4, 2026
2 checks passed
@nlaverdure
nlaverdure deleted the fix-align-encoders-trigger branch August 4, 2026 23:14
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.

1 participant