Skip to content

Commit

Permalink
event: end of quals
Browse files Browse the repository at this point in the history
  • Loading branch information
WeilSimon committed Apr 19, 2024
1 parent d92402d commit 001799e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/team1540/robot2024/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public final class Constants {
public static final boolean IS_COMPETITION_ROBOT = true;
// Whether to pull PID constants from SmartDashboard
private static final boolean tuningMode = false; // TODO: DO NOT SET TO TRUE FOR COMP
private static final boolean tuningMode = true; // TODO: DO NOT SET TO TRUE FOR COMP
private static final Mode simMode = Mode.SIM; // Can also be Mode.REPLAY

public static final Mode currentMode = Robot.isReal() ? Mode.REAL : simMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public ShooterPivotIOTalonFX() {

motor.optimizeBusUtilization();
cancoder.optimizeBusUtilization();
motor.setPosition(absolutePosition.getValueAsDouble() / CANCODER_TO_PIVOT * CHAIN_FACTOR);
motor.setPosition(
Rotation2d.fromRotations(absolutePosition.getValueAsDouble() / CANCODER_TO_PIVOT * CHAIN_FACTOR).plus(Rotation2d.fromRadians(0.03856 - 0.02649405)).getRotations()
);
}

@Override
Expand All @@ -97,7 +99,7 @@ public void updateInputs(ShooterPivotIOInputs inputs) {
inputs.isAtForwardLimit = forwardLimit.getValue() == ForwardLimitValue.ClosedToGround;
inputs.isAtReverseLimit = reverseLimit.getValue() == ReverseLimitValue.ClosedToGround;
inputs.position = Rotation2d.fromRotations(position.getValueAsDouble());
inputs.absolutePosition = Rotation2d.fromRotations(absolutePosition.getValueAsDouble() / CANCODER_TO_PIVOT * CHAIN_FACTOR);
inputs.absolutePosition = Rotation2d.fromRotations(absolutePosition.getValueAsDouble() / CANCODER_TO_PIVOT * CHAIN_FACTOR).plus(Rotation2d.fromRadians(0.03865 - 0.02649405));
inputs.velocityRPS = velocity.getValueAsDouble();
inputs.appliedVolts = appliedVoltage.getValueAsDouble();
inputs.currentAmps = current.getValueAsDouble();
Expand Down

0 comments on commit 001799e

Please sign in to comment.