|
4 | 4 |
|
5 | 5 | package frc.robot;
|
6 | 6 |
|
7 |
| -import com.revrobotics.CANSparkBase.IdleMode; |
8 |
| - |
9 | 7 | import edu.wpi.first.math.geometry.Translation2d;
|
10 | 8 | import edu.wpi.first.math.kinematics.SwerveDriveKinematics;
|
11 | 9 | import edu.wpi.first.math.trajectory.TrapezoidProfile;
|
@@ -66,54 +64,20 @@ public static final class DriveConstants {
|
66 | 64 | }
|
67 | 65 |
|
68 | 66 | public static final class ModuleConstants {
|
69 |
| - // The MAXSwerve module can be configured with one of three pinion gears: 12T, 13T, or 14T. |
70 |
| - // This changes the drive speed of the module (a pinion gear with more teeth will result in a |
71 |
| - // robot that drives faster). |
| 67 | + // The MAXSwerve module can be configured with one of three pinion gears: 12T, |
| 68 | + // 13T, or 14T. This changes the drive speed of the module (a pinion gear with |
| 69 | + // more teeth will result in a robot that drives faster). |
72 | 70 | public static final int kDrivingMotorPinionTeeth = 14;
|
73 | 71 |
|
74 |
| - // Invert the turning encoder, since the output shaft rotates in the opposite direction of |
75 |
| - // the steering motor in the MAXSwerve Module. |
76 |
| - public static final boolean kTurningEncoderInverted = true; |
77 |
| - |
78 | 72 | // Calculations required for driving motor conversion factors and feed forward
|
79 | 73 | public static final double kDrivingMotorFreeSpeedRps = NeoMotorConstants.kFreeSpeedRpm / 60;
|
80 | 74 | public static final double kWheelDiameterMeters = 0.0762;
|
81 | 75 | public static final double kWheelCircumferenceMeters = kWheelDiameterMeters * Math.PI;
|
82 |
| - // 45 teeth on the wheel's bevel gear, 22 teeth on the first-stage spur gear, 15 teeth on the bevel pinion |
| 76 | + // 45 teeth on the wheel's bevel gear, 22 teeth on the first-stage spur gear, 15 |
| 77 | + // teeth on the bevel pinion |
83 | 78 | public static final double kDrivingMotorReduction = (45.0 * 22) / (kDrivingMotorPinionTeeth * 15);
|
84 | 79 | public static final double kDriveWheelFreeSpeedRps = (kDrivingMotorFreeSpeedRps * kWheelCircumferenceMeters)
|
85 | 80 | / kDrivingMotorReduction;
|
86 |
| - |
87 |
| - public static final double kDrivingEncoderPositionFactor = (kWheelDiameterMeters * Math.PI) |
88 |
| - / kDrivingMotorReduction; // meters |
89 |
| - public static final double kDrivingEncoderVelocityFactor = ((kWheelDiameterMeters * Math.PI) |
90 |
| - / kDrivingMotorReduction) / 60.0; // meters per second |
91 |
| - |
92 |
| - public static final double kTurningEncoderPositionFactor = (2 * Math.PI); // radians |
93 |
| - public static final double kTurningEncoderVelocityFactor = (2 * Math.PI) / 60.0; // radians per second |
94 |
| - |
95 |
| - public static final double kTurningEncoderPositionPIDMinInput = 0; // radians |
96 |
| - public static final double kTurningEncoderPositionPIDMaxInput = kTurningEncoderPositionFactor; // radians |
97 |
| - |
98 |
| - public static final double kDrivingP = 0.04; |
99 |
| - public static final double kDrivingI = 0; |
100 |
| - public static final double kDrivingD = 0; |
101 |
| - public static final double kDrivingFF = 1 / kDriveWheelFreeSpeedRps; |
102 |
| - public static final double kDrivingMinOutput = -1; |
103 |
| - public static final double kDrivingMaxOutput = 1; |
104 |
| - |
105 |
| - public static final double kTurningP = 1; |
106 |
| - public static final double kTurningI = 0; |
107 |
| - public static final double kTurningD = 0; |
108 |
| - public static final double kTurningFF = 0; |
109 |
| - public static final double kTurningMinOutput = -1; |
110 |
| - public static final double kTurningMaxOutput = 1; |
111 |
| - |
112 |
| - public static final IdleMode kDrivingMotorIdleMode = IdleMode.kBrake; |
113 |
| - public static final IdleMode kTurningMotorIdleMode = IdleMode.kBrake; |
114 |
| - |
115 |
| - public static final int kDrivingMotorCurrentLimit = 50; // amps |
116 |
| - public static final int kTurningMotorCurrentLimit = 20; // amps |
117 | 81 | }
|
118 | 82 |
|
119 | 83 | public static final class OIConstants {
|
|
0 commit comments