Skip to content

Conversation

@mwitcpalek
Copy link
Contributor

No description provided.

public class CoralConstants {
public static int kCoralFxId = 0;

public static final AngularVelocity kCloseEnough = DegreesPerSecond.of(5);
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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

Copy link
Contributor Author

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

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

@mwitcpalek mwitcpalek merged commit 74d24ac into main Feb 1, 2025
1 check passed
@mwitcpalek mwitcpalek deleted the coral branch February 1, 2025 21:06
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.

5 participants