Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ohowe1 committed Feb 26, 2024
1 parent 789b9d9 commit 448ae2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ private SwerveConstants() {}

public static final TunablePIDGains STEER_POSITION_PID_GAINS =
new TunablePIDGains("/gains/steer", 7.207, 0.0, 0.002, MiscConstants.TUNING_MODE);
// Radians per rotation
private static final double STEER_CONVERSION = (2 * Math.PI);
// Volts/(Radian/Second) to Volts/(Rotation/Second)
public static final TunableFFGains STEER_VELOCITY_FF_GAINS =
new TunableFFGains("/gains/steer", 0.0, 0.0, 0.0, MiscConstants.TUNING_MODE);
new TunableFFGains(
"/gains/steer",
0.0 * STEER_CONVERSION,
0.0 * STEER_CONVERSION,
0.0 * STEER_CONVERSION,
MiscConstants.TUNING_MODE);

// Left right distance between center of wheels
public static final double TRACKWIDTH_METERS = Units.inchesToMeters(22.75);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ private void setSteerReference(double targetAngleRadians, boolean activeSteer) {

if (activeSteer) {
steerMotor.setControl(
steerMotionMagicExpoVoltage.withPosition(Units.radiansToRotations(targetAngleRadians)));
steerMotionMagicExpoVoltage.withPosition(targetAngleRadians * steerConversion));
} else {
steerMotor.setVoltage(0.0);
}
Expand Down

0 comments on commit 448ae2a

Please sign in to comment.