Skip to content

Conversation

@mwitcpalek
Copy link
Contributor

No description provided.

// FX Access objects
TalonFXConfigurator configuratorLeft;
TalonFXConfigurator configuratorRight;
StatusSignal<Double> currVelocites;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The elevator is going to primarily be controlled on position not velocity - we will probably want something like mainPosition and followPosition in the inputs
Can leave a velocity if desired (and using the left main one makes sense) but will need to add positions

configuratorRight.apply(ElevatorConstants.getRightFXConfig());;

// Attach status signals
currVelocites = talonFxLeft.getVelocity();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add both positions here as status signals

public void updateInputs(ExiterIOInputs inputs) {
inputs.velocityLeft = currLeftVelocity.refresh().getValue();
inputs.velocityRight = currRightVelocity.refresh().getValue();
inputs.velocites = currVelocites.refresh().getValue();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use BaseStatusSignal.refreshAll() syntax to reduce CAN bus calls - see example subsystem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add in the absolute position from the analog input here to the inputs

// private MotionMagicVelocityVoltage velocityRequests =
// new MotionMagicVelocityVoltage;

public ExiterIOFX() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will need to add a zero() method to the I/O layer
This subsystem is going to zero using an analog input that gives us the position of the final stage - the analog input can be read, compared to a constant and used to write to the position of both talonFX's

return Set.of();
}

public double getSpeeds() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will not need a getSpeeds() or atSpeed() methods for the elevator as it is position-based

@mwitcpalek mwitcpalek merged commit a7082e7 into main Feb 1, 2025
1 check passed
@mwitcpalek mwitcpalek deleted the elevator branch February 1, 2025 21:51
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.

4 participants