Skip to content

shooter code theorical#2

Closed
AlbedoLinguine wants to merge 2 commits intomasterfrom
shooter
Closed

shooter code theorical#2
AlbedoLinguine wants to merge 2 commits intomasterfrom
shooter

Conversation

@AlbedoLinguine
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Logger import is not used anywhere in this file. This import should be removed.

Suggested change
import frc.team5431.titan.core.misc.Logger;

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +42
this.attached = attached;
this.motor = motor;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
this.attached = attached;
this.motor = motor;

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +47
config.applyTalonConfig(motor);
this.setConfig();
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
config.applyTalonConfig(motor);
this.setConfig();
this.setConfig();
config.applyTalonConfig(motor);

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +72
public AngularVelocity speed;
public double output;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
public AngularVelocity speed;
public double output;
public final AngularVelocity speed;
public final double output;

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +79
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;
}

}
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;
}
}

Copilot uses AI. Check for mistakes.
this.setConfig();
}
public Command runShooterCommand(ShooterModes shooterModes) {
return new RunCommand(() -> setVelocity(shooterMode.speed), this)
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
return new RunCommand(() -> setVelocity(shooterMode.speed), this)
this.shooterMode = shooterModes;
return new RunCommand(() -> setVelocity(this.shooterMode.speed), this)

Copilot uses AI. Check for mistakes.
Comment on lines 8 to +9
import frc.robot.Constants.ShooterConstants;
import frc.robot.Constants.ShooterConstants.ShooterModes;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The imports for IntakeConstants and IntakeModes are not used anywhere in this file. These should be removed.

Copilot uses AI. Check for mistakes.
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