Skip to content

Testing/apr4#82

Merged
y0shi merged 8 commits intodevelopmentfrom
testing/Apr4
Apr 5, 2026
Merged

Testing/apr4#82
y0shi merged 8 commits intodevelopmentfrom
testing/Apr4

Conversation

@y0shi
Copy link
Copy Markdown
Member

@y0shi y0shi commented Apr 5, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

AI Code Review

Hey team! This pull request shows some really great progress, especially with the shooter system. It's fantastic to see the dedication to refining these critical robot components.

Positive Highlights ✨

  • Shooter PID & Motion Magic Implementation: It's excellent to see the shooter's flywheel control re-enabled with PID and the hood leveraging Motion Magic. This will lead to much more precise and consistent shooting, which is crucial for high performance!
  • CTRE Follower Motors: Properly configuring the flywheel motors with CTRE's Follower control ensures they operate synchronously and efficiently, which is a strong best practice.
  • Code Cleanup: The removal of significant blocks of commented-out code and unused preferences across multiple files is fantastic for code readability and maintainability. Great job keeping the codebase tidy!
  • Command Composition: The continued use of command composition (.alongWith(), .andThen()) in RobotContainer is a clear sign of good command-based programming practices, making complex actions easy to read and manage.

Suggestions 🛠️

Robot Safety & Best Practices

  • src/main/java/frc/robot/Robot.java - Thread Priority:
    • Suggestion: Consider adding Thread.currentThread().setPriority(4); in the Robot() constructor.
    • Why it matters: Elevating the main robot thread's priority helps ensure that critical control loop timing is consistent and less susceptible to being interrupted by lower-priority tasks, which can improve robot responsiveness and reliability.
  • src/main/java/frc/robot/Robot.java - Match Logging:
    • Suggestion: It might be helpful to explicitly log match events in autonomousInit() and teleopInit().
    • Why it matters: This aligns with our "Match Logging" guideline. Having timestamps for when autonomous and teleop modes start (and which auto was selected) is invaluable for post-match analysis and debugging, especially with AdvantageKit/Epilogue.
  • src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java - Critical Current Limit Protection:
    • Suggestion: The commented-out current limit protection logic in periodic() (lines 100-105) for the extensionMotor is a significant safety concern. Please re-implement or replace this with an equally robust solution.
    • Why it matters: Our "Mechanism Limits" and "Current Limiting" guidelines emphasize protecting motors from overcurrent. Without this, the intake extension motor could stall against a physical limit or an obstruction, drawing excessive current and potentially damaging the motor or motor controller. This should be a high priority to address.

FRC/WPILib Best Practices

  • src/main/java/frc/robot/subsystems/indexer/IndexerSubsystem.java - PID Re-implementation:
    • Suggestion: I notice that PID-related fields and commands were removed for the indexer, with a "TODO: PUT IT BACK!" comment. While temporary changes for tuning are understandable, remember to prioritize re-implementing PID control for the indexer when ready.
    • Why it matters: Using position or velocity control (PID) for mechanisms generally provides more consistent, precise, and robust behavior compared to direct percent output, especially in varying load conditions.
  • src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java - Homing in Constructor:
    • Suggestion: The line hoodMotor.setPosition(0); in the constructor is great for establishing an initial position. However, if the hood motor uses a relative encoder or isn't guaranteed to be at its home position at robot startup, relying solely on setPosition(0) in the constructor might lead to incorrect position readings.
    • Why it matters: Our "Automatic Homing" guideline suggests a robust homing command that actively drives the mechanism to a known limit (like homeShooterCommand()) and then resets the encoder. Consider if the constructor's setPosition(0) is sufficient or if homeShooterCommand() should be explicitly run at the start of a match or after a reset.

Questions ❓

  • src/main/java/frc/robot/subsystems/indexer/IndexerSubsystem.java - startIndexerReverseNoPID(): The command was changed from run() to runOnce(). Is the intention for the indexer to run in reverse only momentarily, or should it continue running in reverse until interrupted? If it should run continuously, run() would be more appropriate.
  • src/main/java/frc/robot/subsystems/indexer/IndexerSubsystem.java - pulsingIndexCommand() Accelerator Behavior: In the pulsingIndexCommand(), the acceleratorMotor is now continuously set to IndexerPreferences.acceleratorPercent.getValue() while the command is running, even when the indexerMotor pulses off. Is this the desired behavior for the accelerator motor?
  • src/main/java/frc/robot/subsystems/intake/IntakeSubsystem.java - isCompliantMode Removal: The isCompliantMode logic was commented out from setIntakeExtensionCommand(), and the current limit protection that used it was also removed. Could you clarify the intent behind removing this compliant mode? Will its functionality be replaced or is it no longer needed?

Keep up the fantastic work on the robot! These changes are moving us in a great direction. Let's discuss these points in our next meeting.


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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

✓ Build successful and code formatting check passed!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

✓ Build successful and code formatting check passed!

@y0shi y0shi merged commit ebce0e5 into development Apr 5, 2026
2 checks passed
@y0shi y0shi deleted the testing/Apr4 branch April 5, 2026 21:30
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