Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements shooter subsystem functionality by adding state management, velocity control modes, and a command interface for the robot's shooter mechanism.
Changes:
- Added state and mode management to the Shooter subsystem with enum-based configurations
- Introduced PID control parameters and multiple operational speeds (shooting, reverse, idle)
- Created a command method for controlling the shooter via enumerated modes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/main/java/frc/robot/subsystems/shooter/Shooter.java | Added state/mode fields, updated constructor with initialization, and implemented runShooterCommand method with velocity control |
| src/main/java/frc/robot/Constants.java | Added PID gains, speed constants, and ShooterModes enum defining operational modes |
| .vscode/settings.json | Changed default Java formatter from Spotless to Red Hat |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import frc.robot.Constants.ShooterConstants; | ||
| import frc.robot.Constants.ShooterConstants.ShooterModes; | ||
| import frc.robot.Constants.ShooterConstants.ShooterState; | ||
| import frc.team5431.titan.core.misc.Logger; |
There was a problem hiding this comment.
The Logger import is not used anywhere in this file. This import should be removed.
| import frc.team5431.titan.core.misc.Logger; |
| this.attached = attached; | ||
| this.motor = motor; |
There was a problem hiding this comment.
The assignments 'this.attached = attached' and 'this.motor = motor' are redundant since the parent constructor 'super(motor, attached)' already handles these assignments. These lines should be removed.
| this.attached = attached; | |
| this.motor = motor; |
| config.applyTalonConfig(motor); | ||
| this.setConfig(); |
There was a problem hiding this comment.
The setConfig method is called after applyTalonConfig, but setConfig creates a new ShooterConfig and applyTalonConfig likely needs the config to be initialized first. The order should be reversed: call setConfig() before config.applyTalonConfig(motor).
| config.applyTalonConfig(motor); | |
| this.setConfig(); | |
| this.setConfig(); | |
| config.applyTalonConfig(motor); |
| public AngularVelocity speed; | ||
| public double output; |
There was a problem hiding this comment.
The enum fields 'speed' and 'output' should be declared as final since they are set in the constructor and should not be modified after initialization.
| public AngularVelocity speed; | |
| public double output; | |
| public final AngularVelocity speed; | |
| public final double output; |
| SHOOTER(shooterSpeed, 1.0), | ||
| REVERSE(reverseSpeed, -0.5), | ||
| IDLE(idleSpeed, 0.0); | ||
|
|
||
| public AngularVelocity speed; | ||
| public double output; | ||
|
|
||
| ShooterModes(AngularVelocity speed, double output) { | ||
| this.speed = speed; | ||
| this.output = output; | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Inconsistent indentation is used for the ShooterModes enum. The enum values and their fields use extra indentation (8 spaces) compared to the standard 4 spaces used elsewhere in the codebase.
| SHOOTER(shooterSpeed, 1.0), | |
| REVERSE(reverseSpeed, -0.5), | |
| IDLE(idleSpeed, 0.0); | |
| public AngularVelocity speed; | |
| public double output; | |
| ShooterModes(AngularVelocity speed, double output) { | |
| this.speed = speed; | |
| this.output = output; | |
| } | |
| } | |
| SHOOTER(shooterSpeed, 1.0), | |
| REVERSE(reverseSpeed, -0.5), | |
| IDLE(idleSpeed, 0.0); | |
| public AngularVelocity speed; | |
| public double output; | |
| ShooterModes(AngularVelocity speed, double output) { | |
| this.speed = speed; | |
| this.output = output; | |
| } | |
| } |
| this.setConfig(); | ||
| } | ||
| public Command runShooterCommand(ShooterModes shooterModes) { | ||
| return new RunCommand(() -> setVelocity(shooterMode.speed), this) |
There was a problem hiding this comment.
The parameter 'shooterModes' is not used in the method body. The method uses the instance field 'shooterMode' instead of the parameter. Either remove the parameter if it's not needed, or use it to set the shooter mode before applying the velocity.
| return new RunCommand(() -> setVelocity(shooterMode.speed), this) | |
| this.shooterMode = shooterModes; | |
| return new RunCommand(() -> setVelocity(this.shooterMode.speed), this) |
| import frc.robot.Constants.ShooterConstants; | ||
| import frc.robot.Constants.ShooterConstants.ShooterModes; |
There was a problem hiding this comment.
The imports for IntakeConstants and IntakeModes are not used anywhere in this file. These should be removed.
No description provided.