Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shooter #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Shooter #2

wants to merge 9 commits into from

Conversation

prasadbis
Copy link
Collaborator

Created a shooter subsystem.

@prasadbis prasadbis self-assigned this Nov 4, 2024
src/main/java/org/sciborgs1155/robot/Robot.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/WheelIO.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/Shooter.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/Shooter.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/Shooter.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/Shooter.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/SimWheel.java Outdated Show resolved Hide resolved
src/main/java/org/sciborgs1155/robot/shooter/SimWheel.java Outdated Show resolved Hide resolved
motor = new CANSparkMax(id, MotorType.kBrushless);
public RealWheel(boolean inverted, int motorID) {
motor = new CANSparkMax(motorID, MotorType.kBrushless);
motor.setIdleMode(IdleMode.kBrake);
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to reset the motor settings to their defaults before configuration!

}

public static final class Bottom {
public static final double kp = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Remember in testing to change this. Otherwise, your pids won't be doing any work

}

@Log.NT
public double topTarget() {
Copy link
Member

Choose a reason for hiding this comment

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

topSetpoint is better and more specific here; target could refer to a set state, for instance, and setpoint is the more general term for the reference

private final WheelIO top;
private final WheelIO bottom;

private final PIDController pidTop = new PIDController(Top.kp, Top.ki, Top.kd);
Copy link
Member

Choose a reason for hiding this comment

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

WPILib PIDControllers are sendable, so you should log these. Helps the testing process massively by allowing you to change PID constants dynamically over NT

Unfortunately, feedforward isn't (though there shouldn't ever be a need to change those in the middle of a match.)

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