diff --git a/src/main/java/frc/lib/util/swerve/SwerveModuleIO.java b/src/main/java/frc/lib/util/swerve/SwerveModuleIO.java index 011a051..33a4d25 100644 --- a/src/main/java/frc/lib/util/swerve/SwerveModuleIO.java +++ b/src/main/java/frc/lib/util/swerve/SwerveModuleIO.java @@ -16,18 +16,18 @@ public static class SwerveModuleInputs { // public double angleMotorTemp; } - public default void setModNumber(int number) {} + public void setModNumber(int number); - public default void updateInputs(SwerveModuleInputs inputs) {} + public void updateInputs(SwerveModuleInputs inputs); - public default void setDriveMotor(double mps) {} + public void setDriveMotor(double mps); - public default void setDriveMotorPower(double power) {} + public void setDriveMotorPower(double power); - public default void setAngleMotor(double angle) {} + public void setAngleMotor(double angle); - public default void setAngleSelectedSensorPosition(double angle) {} + public void setAngleSelectedSensorPosition(double angle); - public default void setPositionAngleMotor(double absolutePosition) {} + public void setPositionAngleMotor(double absolutePosition); } diff --git a/src/main/java/frc/lib/util/swerve/SwerveModuleReal.java b/src/main/java/frc/lib/util/swerve/SwerveModuleReal.java index c015ae7..cc56598 100644 --- a/src/main/java/frc/lib/util/swerve/SwerveModuleReal.java +++ b/src/main/java/frc/lib/util/swerve/SwerveModuleReal.java @@ -158,4 +158,23 @@ public void setPositionAngleMotor(double absolutePosition) { mAngleMotor.setPosition(absolutePosition); } + @Override + public void setModNumber(int number) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'setModNumber'"); + } + + @Override + public void setDriveMotorPower(double power) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'setDriveMotorPower'"); + } + + @Override + public void setAngleSelectedSensorPosition(double angle) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException( + "Unimplemented method 'setAngleSelectedSensorPosition'"); + } + } diff --git a/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java b/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java index 7cc8166..c0de8f0 100644 --- a/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java +++ b/src/main/java/frc/lib/util/swerve/SwerveModuleSim.java @@ -89,4 +89,23 @@ public void setDriveVoltage(double volts) { driveAppliedVolts = MathUtil.clamp(volts, -12.0, 12.0); driveSim.setInputVoltage(driveAppliedVolts); } + + @Override + public void setDriveMotorPower(double power) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'setDriveMotorPower'"); + } + + @Override + public void setAngleSelectedSensorPosition(double angle) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException( + "Unimplemented method 'setAngleSelectedSensorPosition'"); + } + + @Override + public void setPositionAngleMotor(double absolutePosition) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'setPositionAngleMotor'"); + } } diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index c5e04d3..ad854cc 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -212,7 +212,7 @@ public static final class Swerve { /* Module Gear Ratios */ public static final double driveGearRatio = (8.14 / 1.0); // MK4i L1 - public static final double angleGearRatio = ((150.0 / 7.0) / 1.0); // (150 / 7) : 1 + public static final double angleGearRatio = (12.8 / 1.0); // (150 / 7) : 1 /* Motor Inverts */ public static final InvertedValue angleMotorInvert = InvertedValue.Clockwise_Positive; @@ -278,7 +278,7 @@ public static final class Mod0 { public static final int angleMotorID = 6; public static final int canCoderID = 4; // public static final Rotation2d angleOffset = Rotation2d.fromDegrees(183.955078125); - public static final Rotation2d angleOffset = Rotation2d.fromRotations(0.376953 + 0.5); + public static final Rotation2d angleOffset = Rotation2d.fromRotations(0.376221 + 0.75); } @@ -290,7 +290,7 @@ public static final class Mod1 { public static final int angleMotorID = 5; public static final int canCoderID = 3; // public static final Rotation2d angleOffset = Rotation2d.fromDegrees(325.01953125); - public static final Rotation2d angleOffset = Rotation2d.fromRotations(-0.357178); + public static final Rotation2d angleOffset = Rotation2d.fromRotations(-0.355957 + 0.25); } @@ -302,7 +302,7 @@ public static final class Mod2 { public static final int angleMotorID = 7; public static final int canCoderID = 2; // public static final Rotation2d angleOffset = Rotation2d.fromDegrees(124.62890625); - public static final Rotation2d angleOffset = Rotation2d.fromRotations(0.278809); + public static final Rotation2d angleOffset = Rotation2d.fromRotations(-0.223145 + 0.75); } @@ -314,7 +314,7 @@ public static final class Mod3 { public static final int angleMotorID = 8; public static final int canCoderID = 1; // public static final Rotation2d angleOffset = Rotation2d.fromDegrees(295.400390625); - public static final Rotation2d angleOffset = Rotation2d.fromRotations(-0.409180 + 0.5); + public static final Rotation2d angleOffset = Rotation2d.fromRotations(0.095459 + 0.25); } public static final HolonomicPathFollowerConfig pathFollowerConfig =