Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/awtybots/FRC-2024 in…
Browse files Browse the repository at this point in the history
…to development
  • Loading branch information
JadedHearth committed Feb 25, 2024
2 parents e6ec1db + 1791983 commit c6cb18f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/main/java/frc/robot/subsystems/drive/GyroIONavX.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public GyroIONavX(boolean phoenixDrive) {
ahrs.zeroYaw();

yawPositionQueue =
SparkMaxOdometryThread.getInstance().registerSignal(() -> (double) ahrs.getYaw());
SparkMaxOdometryThread.getInstance().registerSignal(() -> (double) ahrs.getYaw() * -1);
}

@Override
Expand All @@ -54,10 +54,12 @@ public void updateInputs(GyroIOInputs inputs) {
// yawPositionQueue.clear();
inputs.connected = ahrs.isConnected();
inputs.calibrating = ahrs.isCalibrating();
inputs.yawPosition = Rotation2d.fromDegrees(ahrs.getYaw());
inputs.yawPosition = Rotation2d.fromDegrees(ahrs.getYaw() * -1);
inputs.yawVelocityRadPerSec = Units.degreesToRadians(ahrs.getRawGyroZ());
inputs.odometryYawPositions =
yawPositionQueue.stream().map(Rotation2d::fromDegrees).toArray(Rotation2d[]::new);
yawPositionQueue.stream()
.map((Double value) -> Rotation2d.fromDegrees(value))
.toArray(Rotation2d[]::new);

yawPositionQueue.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public class ModuleIOSparkMax implements ModuleIO {
// Gear ratios for SDS MK4i L2, adjust as necessary
private static final double DRIVE_GEAR_RATIO = (50.0 / 14.0) * (17.0 / 27.0) * (45.0 / 15.0);
private static final double DRIVE_GEAR_RATIO = 5.08 / 1.0;
private static final double TURN_GEAR_RATIO = 1.0; // 46.42/1.0;
private static final double RELATIVE_ENCODER_TURN_GEAR_RATIO = 46.42 / 1.0;

Expand Down Expand Up @@ -108,8 +108,8 @@ public ModuleIOSparkMax(int index) {
turnAbsoluteEncoderNew.setInverted(true);

turnSparkMax.setInverted(isTurnMotorInverted);
driveSparkMax.setSmartCurrentLimit(40);
turnSparkMax.setSmartCurrentLimit(30);
driveSparkMax.setSmartCurrentLimit(30);
turnSparkMax.setSmartCurrentLimit(20);
driveSparkMax.enableVoltageCompensation(12.0);
turnSparkMax.enableVoltageCompensation(12.0);

Expand Down

0 comments on commit c6cb18f

Please sign in to comment.