diff --git a/src/main/java/frc/robot/CanID.java b/src/main/java/frc/robot/CanID.java index 7896199..ad9a61a 100644 --- a/src/main/java/frc/robot/CanID.java +++ b/src/main/java/frc/robot/CanID.java @@ -14,8 +14,9 @@ public enum CanID { INTAKE_MOTOR(9), INTAKE_DEPLOY_MOTOR(11), - - ; + + TURRET_PINION_CANCODER(12), + TURRET_FOLLOWER_CANCODER(14); private final int deviceID; diff --git a/src/main/java/frc/robot/generated/TunerConstants.java b/src/main/java/frc/robot/generated/TunerConstants.java index 9aab639..02b995e 100644 --- a/src/main/java/frc/robot/generated/TunerConstants.java +++ b/src/main/java/frc/robot/generated/TunerConstants.java @@ -267,10 +267,10 @@ public TunerSwerveDrivetrain( * unspecified or set to 0 Hz, this is 250 Hz on * CAN FD, and 100 Hz on CAN 2.0. * @param odometryStandardDeviation The standard deviation for odometry calculation - * in the form [x, y, theta]ᵀ, with units in meters + * in the form [x, y, theta], with units in meters * and radians * @param visionStandardDeviation The standard deviation for vision calculation - * in the form [x, y, theta]ᵀ, with units in meters + * in the form [x, y, theta], with units in meters * and radians * @param modules Constants for each specific module */ diff --git a/src/main/java/frc/robot/subsystems/drive/CommandSwerveDrivetrain.java b/src/main/java/frc/robot/subsystems/drive/CommandSwerveDrivetrain.java index 35641ee..4e774aa 100644 --- a/src/main/java/frc/robot/subsystems/drive/CommandSwerveDrivetrain.java +++ b/src/main/java/frc/robot/subsystems/drive/CommandSwerveDrivetrain.java @@ -189,10 +189,10 @@ public CommandSwerveDrivetrain( * unspecified or set to 0 Hz, this is 250 Hz on * CAN FD, and 100 Hz on CAN 2.0. * @param odometryStandardDeviation The standard deviation for odometry calculation - * in the form [x, y, theta]ᵀ, with units in meters + * in the form [x, y, theta], with units in meters * and radians * @param visionStandardDeviation The standard deviation for vision calculation - * in the form [x, y, theta]ᵀ, with units in meters + * in the form [x, y, theta], with units in meters * and radians * @param modules Constants for each specific module */ @@ -306,7 +306,7 @@ public void addVisionMeasurement(Pose2d visionRobotPoseMeters, double timestampS * @param visionRobotPoseMeters The pose of the robot as measured by the vision camera. * @param timestampSeconds The timestamp of the vision measurement in seconds. * @param visionMeasurementStdDevs Standard deviations of the vision pose measurement - * in the form [x, y, theta]ᵀ, with units in meters and radians. + * in the form [x, y, theta], with units in meters and radians. */ @Override public void addVisionMeasurement( diff --git a/src/main/java/frc/robot/subsystems/turret/calc/TurretMath.java b/src/main/java/frc/robot/subsystems/turret/calc/TurretMath.java index dbd66e8..ab3d431 100644 --- a/src/main/java/frc/robot/subsystems/turret/calc/TurretMath.java +++ b/src/main/java/frc/robot/subsystems/turret/calc/TurretMath.java @@ -6,10 +6,10 @@ * * Hardware setup (example): * - Turret gear: 140 teeth - * - Encoder A: e.g. 13-tooth gear driving an absolute encoder (reads 0–1 rev) - * - Encoder B: e.g. 11-tooth gear driving an absolute encoder (reads 0–1 rev) + * - Encoder A: e.g. 13-tooth gear driving an absolute encoder (reads 0-1 rev) + * - Encoder B: e.g. 11-tooth gear driving an absolute encoder (reads 0-1 rev) * - * The combination gives unique positions over (encoderA_teeth × encoderB_teeth) teeth. + * The combination gives unique positions over (encoderA_teeth x encoderB_teeth) teeth. * Beyond that range, continuity tracking (unwrapping) is used. */ public class TurretMath { @@ -20,8 +20,8 @@ public class TurretMath { private static final double ENCODER_B_TEETH = 11.0; // Derived encoder combination values - private static final double ENCODER_COMBINED_TEETH = ENCODER_A_TEETH * ENCODER_B_TEETH; // 143 (example) - private static final double ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_TEETH / TURRET_GEAR_TEETH; // ≈1.0214 (example) + private static final double ENCODER_COMBINED_TEETH = ENCODER_A_TEETH * ENCODER_B_TEETH; + private static final double ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_TEETH / TURRET_GEAR_TEETH; private static final double HALF_ENCODER_COMBINED_PERIOD_REV = ENCODER_COMBINED_PERIOD_REV / 2.0; private static final double NORMALIZED_REV = 1.0; // encoder reading range (0..1) @@ -140,7 +140,7 @@ public static double toDegreesWrapped(double turretRevs) { } /** - * Convert turret revolutions to radians, wrapped to [0, 2π). + * Convert turret revolutions to radians, wrapped to [0, 2pi). */ public static double toRadiansWrapped(double turretRevs) { return mod(turretRevs, NORMALIZED_REV) * RAD_PER_REV;