Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit 5f41818

Browse files
update gear ratio
1 parent 4d0849a commit 5f41818

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public class RobotContainer {
109109
new BeamBreakIOAdafruit(SpindexConstants.kSpindexBeamBreakDIO));
110110
private final Vision vision = new Vision(new VisionIOLimelight());
111111

112-
// private final Superstructure superstructure = // TODO: when uncommented also
113-
// uncomment the
112+
// private final Superstructure superstructure = // TODO: when uncommented also uncomment the
114113
// periodic
115114
// new Superstructure(
116115
// ampevator,

src/main/java/frc/robot/subsystems/spindex/SpindexConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SpindexConstants {
1515
public static final int spindexMotorID = 50;
1616
public static final double spindexMotorVoltage = -7;
1717
public static TalonFXConfiguration spindexMotorConfigs =
18-
new TalonFXConfiguration() // TODO: tune
18+
new TalonFXConfiguration()
1919
.withSlot0(new Slot0Configs().withKS(0).withKV(0.1).withKP(1).withKI(0).withKD(0))
2020
.withMotorOutput(
2121
new MotorOutputConfigs()
@@ -36,7 +36,7 @@ public class SpindexConstants {
3636
public static boolean useMotionMagic = false;
3737
public static int kSpindexBeamBreakDIO = 1;
3838
public static TalonFXConfiguration feederMotorConfigs =
39-
new TalonFXConfiguration() // TODO: tune
39+
new TalonFXConfiguration()
4040
.withSlot0(new Slot0Configs().withKS(0).withKV(0.1).withKP(1).withKI(0).withKD(0))
4141
.withMotorOutput(
4242
new MotorOutputConfigs()

src/main/java/frc/robot/subsystems/swerve/SwerveConstants.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
public final class SwerveConstants {
1616
public static final PhoenixPIDController azimuthController =
17-
new PhoenixPIDController(6, 0, 0); // you shouldn't have a I or D value TODO: tune
17+
new PhoenixPIDController(6, 0, 0); // you shouldn't have a I or D value
1818
public static final PIDConstants autoRotationalController =
1919
new PIDConstants(6, azimuthController.getI(), azimuthController.getD()); // should be the same
2020
public static final PIDConstants autoTranslationalController =
21-
new PIDConstants(8, 0, 0); // you shouldn't have a I or D value TODO: tune
21+
new PIDConstants(8, 0, 0); // you shouldn't have a I or D value
2222

2323
public static final List<Double> azimuthAngles = List.of(0.0, 90.0, 180.0, 270.0);
24-
public static final double azimuthEpsilon = 10.0; // TODO: tune
24+
public static final double azimuthEpsilon = 10.0;
2525

2626
public static final PIDController choreoTranslationController = new PIDController(8, 0, 0);
2727
public static final PIDController choreoRotationController =

src/main/java/frc/robot/subsystems/turret/Turret.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public Command setPositionFieldRelative(Rotation2d position, CommandSwerveDrivet
9393
*/
9494
public Command setPosition(Rotation2d position) {
9595
return this.runOnce(
96-
() -> turretIO.setPosition(position.getRotations() * TurretConstants.gearRatio));
96+
() -> turretIO.setPosition(position.getRotations() / TurretConstants.gearRatio));
9797
}
9898

9999
/**
100100
* @return Command to zero the turret motor's encoder position
101101
*/
102102
public Command zero() {
103-
return this.runOnce(() -> turretIO.zero());
103+
return this.runOnce(turretIO::zero);
104104
}
105105

106106
/**

src/main/java/frc/robot/subsystems/turret/TurretConstants.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414

1515
public final class TurretConstants {
1616

17-
public static int kCanCoderID1 = 41; // TODO: set id
18-
public static int kCanCoderID2 = 42; // TODO: set id
17+
public static int kCanCoderID1 = 41;
18+
public static int kCanCoderID2 = 42;
1919

20-
public static final double gearRatio = 1; // TODO: Set gear ratio
20+
public static final double gearRatio = 10.0 / 133; // TODO: Set gear ratio
2121
public static final CANcoderConfiguration canCoderConfig =
22-
new CANcoderConfiguration()
23-
.withMagnetSensor(new MagnetSensorConfigs().withMagnetOffset(0)); // TODO: set config
22+
new CANcoderConfiguration().withMagnetSensor(new MagnetSensorConfigs().withMagnetOffset(0));
2423
public static final double updateFrequency = 50.0;
2524

26-
public static final int kTurretMotorID = 52; // TODO: Set ID
25+
public static final int kTurretMotorID = 52;
2726

2827
public static final double followTagP = 1;
2928
public static final double followTagI = 0;
@@ -40,7 +39,7 @@ public final class TurretConstants {
4039
new Slot0Configs()
4140
.withKS(0)
4241
.withKV(0.05)
43-
.withKP(25)
42+
.withKP(1)
4443
.withKI(0)
4544
.withKD(0) // Original 0.145
4645
)

src/main/java/frc/robot/subsystems/vision/VisionConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public final class VisionConstants {
1616
public static final String turretLimelight = "limelight-speaker";
1717

1818
public static final double noteLimelightAngleDegrees = -29; // old -20.827
19-
public static final double noteLimelightHeightInches = 21; // TODO: idk tune
20-
public static final double noteHeightInches = 2; // TODO: idk tune
19+
public static final double noteLimelightHeightInches = 21;
20+
public static final double noteHeightInches = 2;
2121

2222
public static final Transform2d robotToCam =
2323
new Transform2d(

0 commit comments

Comments
 (0)