Skip to content

Commit 7bd5b41

Browse files
authored
Merge pull request #85 from HighlanderRobotics/new-shooter-ratio
New shooter ratio
2 parents 916f6ae + 010e3cd commit 7bd5b41

4 files changed

Lines changed: 39 additions & 37 deletions

File tree

src/main/java/frc/robot/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public Robot() {
422422
: new FlywheelIOSim(
423423
TurretSubsystem.getFlywheelConfig(),
424424
canivore,
425-
TurretSubsystem.FLYWHEEL_GEAR_RATIO,
425+
TurretSubsystem.NEW_FLYWHEEL_GEAR_RATIO,
426426
11,
427427
12),
428428
ROBOT_MODE == RobotMode.REAL

src/main/java/frc/robot/subsystems/shooter/TurretSubsystem.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public class TurretSubsystem extends SubsystemBase implements Shooter {
5959
/** Creates a new TurretSubsystem. */
6060
public static final double HOOD_GEAR_RATIO = 33.8671875; // 58.96875;
6161

62-
public static final double FLYWHEEL_GEAR_RATIO = 20.0 / 18.0; // 0.84615384615;
62+
public static final double OLD_FLYWHEEL_GEAR_RATIO = 20.0 / 18.0; // 0.84615384615;
63+
64+
public static final double NEW_FLYWHEEL_GEAR_RATIO = 25.0 / 12.0;
6365

6466
public static final Rotation2d HOOD_MAX_ANGLE = Rotation2d.fromDegrees(56);
6567
public static final Rotation2d HOOD_MIN_ANGLE = Rotation2d.fromDegrees(11.33);
@@ -508,12 +510,12 @@ public static TalonFXConfiguration getFlywheelConfig() {
508510
config.MotorOutput.NeutralMode = NeutralModeValue.Coast;
509511
config.MotorOutput.Inverted = InvertedValue.CounterClockwise_Positive;
510512

511-
config.Feedback.SensorToMechanismRatio = TurretSubsystem.FLYWHEEL_GEAR_RATIO;
513+
config.Feedback.SensorToMechanismRatio = TurretSubsystem.NEW_FLYWHEEL_GEAR_RATIO;
512514

513515
// slot 0 is for velocity
514-
config.Slot0.kS = 0.33706; // 0.63933;
515-
config.Slot0.kV = 0.13893; // 0.11582;
516-
config.Slot0.kA = 0.030026; // 0.020809;
516+
config.Slot0.kS = 0.17257; // 0.33706; // 0.63933;
517+
config.Slot0.kV = 0.25853; // 0.13893; // 0.11582;
518+
config.Slot0.kA = 0.031279; // 0.030026; // 0.020809;
517519
config.Slot0.kP = 0.67;
518520
config.Slot0.kD = 0;
519521

src/main/java/frc/robot/subsystems/swerve/constants/comp/R1WispSwerveConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public Pigeon2Configuration getGyroConfig() {
204204
config.MountPose.MountPoseYaw =
205205
-175.72914123535156; // -90.44647216796875; // -90.93168640136719; // -86.66709899902344;
206206

207-
config.GyroTrim.GyroScalarZ = -4;//-2.5;
207+
config.GyroTrim.GyroScalarZ = -4; // -2.5;
208208
return config;
209209
}
210210

src/main/java/frc/robot/utils/autoaim/ShotTrees.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,81 +42,81 @@ public class ShotTrees {
4242
1.716849,
4343
new ShotData(
4444
Rotation2d.fromDegrees(23 - 13.16),
45-
30 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
45+
0.95 * (30 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
4646
0.8));
4747
COMP_HUB_SHOT_TREE.put(
4848
2.017596,
4949
new ShotData(
5050
Rotation2d.fromDegrees(23 - 13.16),
51-
33 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
51+
0.95 * (33 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
5252
0.9));
5353
COMP_HUB_SHOT_TREE.put(
5454
2.423868,
5555
new ShotData(
5656
Rotation2d.fromDegrees(25 - 13.16),
57-
35 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
57+
0.95 * (35 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
5858
1.1));
5959
COMP_HUB_SHOT_TREE.put(
6060
2.664198,
6161
new ShotData(
6262
Rotation2d.fromDegrees(26 - 13.16),
63-
36 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
63+
0.95 * (36 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
6464
1.2));
6565
COMP_HUB_SHOT_TREE.put(
6666
2.903207,
6767
new ShotData(
6868
Rotation2d.fromDegrees(30 - 13.16),
69-
35 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
69+
0.95 * (35 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
7070
1.2));
7171
COMP_HUB_SHOT_TREE.put(
7272
3.156802,
7373
new ShotData(
7474
Rotation2d.fromDegrees(32 - 13.16),
75-
35 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
75+
0.95 * (35 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
7676
1.23));
7777
COMP_HUB_SHOT_TREE.put(
7878
3.437033,
7979
new ShotData(
8080
Rotation2d.fromDegrees(34 - 13.16),
81-
35 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
81+
0.95 * (35 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
8282
1.25));
8383
COMP_HUB_SHOT_TREE.put(
8484
3.611052,
8585
new ShotData(
8686
Rotation2d.fromDegrees(38 - 13.16),
87-
34 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
87+
0.95 * (34 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
8888
1.24));
8989
COMP_HUB_SHOT_TREE.put(
9090
3.773999,
9191
new ShotData(
9292
Rotation2d.fromDegrees(39 - 13.16),
93-
34 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
93+
0.95 * (34 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
9494
1.21));
9595
COMP_HUB_SHOT_TREE.put(
9696
3.899275,
9797
new ShotData(
9898
Rotation2d.fromDegrees(40 - 13.16),
99-
34 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
99+
0.95 * (34 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
100100
1.2));
101101
COMP_HUB_SHOT_TREE.put(
102102
4.138058,
103103
new ShotData(
104104
Rotation2d.fromDegrees(41 - 13.16),
105-
34 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
105+
0.95 * (34 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1),
106106
1.13));
107107

108108
// budget shots
109-
COMP_HUB_SHOT_TREE.put(4.172776, new ShotData(Rotation2d.fromDegrees(36), 25.5, 1.13));
109+
COMP_HUB_SHOT_TREE.put(4.172776, new ShotData(Rotation2d.fromDegrees(36), 0.95 * 25.5, 1.13));
110110

111-
COMP_HUB_SHOT_TREE.put(4.512483, new ShotData(Rotation2d.fromDegrees(34), 25.5, 1.2));
111+
COMP_HUB_SHOT_TREE.put(4.512483, new ShotData(Rotation2d.fromDegrees(34), 0.95 * 25.5, 1.2));
112112

113-
COMP_HUB_SHOT_TREE.put(4.974656, new ShotData(Rotation2d.fromDegrees(39), 27, 1.2));
113+
COMP_HUB_SHOT_TREE.put(4.974656, new ShotData(Rotation2d.fromDegrees(39), 0.95 * 27, 1.2));
114114

115-
COMP_HUB_SHOT_TREE.put(5.116029, new ShotData(Rotation2d.fromDegrees(39.5), 27.5, 1.1));
115+
COMP_HUB_SHOT_TREE.put(5.116029, new ShotData(Rotation2d.fromDegrees(39.5), 0.95 * 27.5, 1.1));
116116

117-
COMP_HUB_SHOT_TREE.put(5.509574, new ShotData(Rotation2d.fromDegrees(40), 28, 1.12));
117+
COMP_HUB_SHOT_TREE.put(5.509574, new ShotData(Rotation2d.fromDegrees(40), 0.95 * 28, 1.12));
118118

119-
COMP_HUB_SHOT_TREE.put(5.63499, new ShotData(Rotation2d.fromDegrees(40), 28, 1.12));
119+
COMP_HUB_SHOT_TREE.put(5.63499, new ShotData(Rotation2d.fromDegrees(40), 0.95 * 28, 1.12));
120120

121121
// COMP_HUB_SHOT_TREE.put(
122122
// 4.602258,
@@ -175,80 +175,80 @@ public class ShotTrees {
175175
Units.feetToMeters(18),
176176
new ShotData(
177177
Rotation2d.fromDegrees(40 - 13.16),
178-
36 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
178+
36 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
179179
1.42)); // - 2, 1.42));
180180
FEED_SHOT_TREE.put(
181181
Units.feetToMeters(20),
182182
new ShotData(
183183
Rotation2d.fromDegrees(43 - 13.16),
184-
38 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
184+
38 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
185185
1.36)); // - 2, 1.36));
186186
FEED_SHOT_TREE.put(
187187
Units.feetToMeters(22),
188188
new ShotData(
189189
Rotation2d.fromDegrees(45 - 13.16),
190-
39 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
190+
39 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
191191
1.34)); // - 2, 1.34));
192192
FEED_SHOT_TREE.put(
193193
Units.feetToMeters(24),
194194
new ShotData(
195195
Rotation2d.fromDegrees(47 - 13.16),
196-
40 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
196+
40 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
197197
1.25)); // - 2, 1.25));
198198
FEED_SHOT_TREE.put(
199199
Units.feetToMeters(26),
200200
new ShotData(
201201
Rotation2d.fromDegrees(48 - 13.16),
202-
41 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
202+
41 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
203203
1.28)); // - 2, 1.28));
204204
FEED_SHOT_TREE.put(
205205
Units.feetToMeters(28),
206206
new ShotData(
207207
Rotation2d.fromDegrees(49 - 13.16),
208-
43 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
208+
43 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
209209
1.27)); // - 2, 1.27));
210210
FEED_SHOT_TREE.put(
211211
Units.feetToMeters(30),
212212
new ShotData(
213213
Rotation2d.fromDegrees(49 - 13.16),
214-
44 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
214+
44 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
215215
1.32)); // - 2, 1.32));
216216
FEED_SHOT_TREE.put(
217217
Units.feetToMeters(32),
218218
new ShotData(
219219
Rotation2d.fromDegrees(49 - 13.16),
220-
46 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
220+
46 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
221221
1.4)); // - 2, 1.4));
222222

223223
FEED_SHOT_TREE.put(
224224
Units.feetToMeters(34),
225225
new ShotData(
226226
Rotation2d.fromDegrees(52 - 13.16),
227-
47 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
227+
47 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
228228
1.3)); // - 2, 1.3));
229229
FEED_SHOT_TREE.put(
230230
Units.feetToMeters(36),
231231
new ShotData(
232232
Rotation2d.fromDegrees(53 - 13.16),
233-
51 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
233+
51 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
234234
1.33)); // - 2, 1.33));
235235
FEED_SHOT_TREE.put(
236236
Units.feetToMeters(38),
237237
new ShotData(
238238
Rotation2d.fromDegrees(53 - 13.16),
239-
55 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
239+
55 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
240240
1.3)); // - 2, 1.3));
241241
FEED_SHOT_TREE.put(
242242
Units.feetToMeters(40),
243243
new ShotData(
244244
Rotation2d.fromDegrees(55 - 13.16),
245-
55 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
245+
55 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
246246
1.2)); // - 2, 1.2));
247247
FEED_SHOT_TREE.put(
248248
Units.feetToMeters(42),
249249
new ShotData(
250250
Rotation2d.fromDegrees(56 - 13.16),
251-
57 * 0.84615384615 / TurretSubsystem.FLYWHEEL_GEAR_RATIO + 1,
251+
57 * 0.84615384615 / TurretSubsystem.OLD_FLYWHEEL_GEAR_RATIO + 1,
252252
1.2)); // - 2, 1.2));
253253
}
254254

0 commit comments

Comments
 (0)