-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Coral Subsystem #5
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
Conversation
| public class CoralConstants { | ||
| public static int kCoralFxId = 0; | ||
|
|
||
| public static final AngularVelocity kCloseEnough = DegreesPerSecond.of(5); |
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.
We will probably do this in rotations per second but that doesn't really matter here
| } | ||
|
|
||
| @Override | ||
| public void updateInputs(CoralIOInputs inputs) { |
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.
Switch this over to refreshAll syntax to avoid multiple can bus calls
BaseStatusSignal.refreshAll(curVelocity, fwdLimitSwitch, revLimitSwitch);
| return Set.of(new Measure("State", () -> curState.ordinal())); | ||
| } | ||
|
|
||
| public enum CoralState { |
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.
Coral subsystem doesn't zero
The states for the coral subsystem will be based on whether or not the subsystem has a coral (or where the coral is in the mechanism)
On loading, one of the beam breaks will show the coral is starting to enter the mechanism, the other will show that it is fully loaded
On ejecting, one of the beam breaks will show that it is fully out of the mechanism
| public void periodic() { | ||
| // Read Inputs | ||
| io.updateInputs(inputs); | ||
|
|
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.
Need to add Logger.processInputs(), see example subsystem for an example of this
| public void updateInputs(CoralIOInputs inputs) { | ||
| inputs.velocity = curVelocity.refresh().getValue(); | ||
| inputs.isFwdLimitSwitchClosed = fwdLimitSwitch.refresh().getValue().value == 1; | ||
| inputs.isRevLimitSwitchClosed = revLimitSwitch.refresh().getValue().value == 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.
Likely these will either both be 1 or both 0, but we won't know until we get hardware
No description provided.