-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
src/main/java/org/sciborgs1155/robot/shooter/ShooterConstants.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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.)
Created a shooter subsystem.