Skip to content

Debug/default command#31

Merged
y0shi merged 3 commits intodevelopmentfrom
debug/defaultCommand
Feb 25, 2026
Merged

Debug/default command#31
y0shi merged 3 commits intodevelopmentfrom
debug/defaultCommand

Conversation

@Orcasphynx
Copy link
Collaborator

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

AI Code Review

Hey team!

This pull request introduces some fantastic structural improvements to how we manage commands and robot modes. It's great to see these changes making our command-based architecture even more robust and organized!

Positive Highlights

  1. Improved Organization and Clarity: Splitting configureBindings into configureTeleopBindings and configureTestBindings in RobotContainer is a huge win for clarity and maintainability. It makes it much easier to understand what commands are active in each mode.
  2. Explicit Mode Lifecycle Management: Calling these configuration methods (and configureSubsystemDefaultCommands) directly from Robot.java's teleopInit() and testInit() ensures that our robot is always correctly configured for the mode it's entering. This is a best practice for managing command lifecycles.
  3. Correct Placement of Disabled Command: Moving the SwerveRequest.Idle command for disabled mode into the RobotContainer constructor is excellent. This ensures it's always active when the robot is disabled, which is a key safety and resource management consideration.
  4. Dedicated Test Bindings: Consolidating SysId routines and SignalLogger controls within configureTestBindings() is perfect for focused debugging and characterization without cluttering our main teleop controls.

Suggestions

  1. FRC/WPILib Best Practices - Logging in Test Mode:

    • Robot.java Line 120 (SignalLogger.stop() in testInit()): Consider the implications of calling SignalLogger.stop() at the beginning of testInit(). Our team guidelines emphasize comprehensive logging (like CTRE Hoot logging) for analysis. If we're running SysId routines or other tests, we'd typically want SignalLogger to be active to capture all the detailed motor data. It might be helpful to either remove this line if you intend to log during tests, or add a comment explaining a specific scenario where disabling logging in testInit() is desired.
  2. Java Standards - Avoiding Code Duplication:

    • RobotContainer.java Lines 117 and 147 (driverJoystick.start().onTrue(drivetrain.runOnce(drivetrain::seedFieldCentric));): The command to seed the field-centric heading is currently duplicated in both configureTestBindings() and configureTeleopBindings(). One approach could be to extract this into a private helper method if it truly needs to be in both places, or to decide if it's primarily a teleop driver control and remove it from configureTestBindings() (unless there's a specific testing scenario that requires the driver to manually re-seed the pose).
  3. Code Quality - Comments and Documentation:

    • Robot.java Line 90 (disabledInit()): You added an empty line inside disabledInit(). While not a functional change, it might be slightly clearer to either keep it as a single line public void disabledInit() {} or, if there's a future intention, add a brief comment like // No specific actions needed in disabledInit for now.

Questions

  1. Could you clarify the intent behind stopping SignalLogger at the beginning of testInit()? Are there specific scenarios where you want to prevent CTRE Hoot logging during test mode, even when running diagnostic commands like SysId?

This refactoring is a significant step forward for our codebase, making it more robust and easier to manage. Excellent work on these improvements! Keep up the great work!


This review was automatically generated by AI. Please use your judgment and feel free to discuss any suggestions!

@github-actions
Copy link

✓ Build successful and code formatting check passed!

@y0shi y0shi merged commit 70f3828 into development Feb 25, 2026
2 checks passed
@y0shi y0shi deleted the debug/defaultCommand branch February 25, 2026 17:07
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.

2 participants