Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit e7508c7

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 8d1cb5c + 73873fe commit e7508c7

15 files changed

+301
-14
lines changed

Diff for: simgui.json

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
}
3535
},
3636
"/Shuffleboard/Odometry/Field/Field": {
37+
"bottom": 1476,
38+
"height": 8.210550308227539,
39+
"left": 150,
40+
"right": 2961,
41+
"top": 79,
42+
"width": 16.541748046875,
3743
"window": {
3844
"visible": true
3945
}

Diff for: src/main/deploy/pathplanner/autos/cmp.elims.987.auto

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"version": 1.0,
3+
"startingPose": {
4+
"position": {
5+
"x": 1.3842846515935527,
6+
"y": 1.5341195874973776
7+
},
8+
"rotation": 0
9+
},
10+
"command": {
11+
"type": "sequential",
12+
"data": {
13+
"commands": [
14+
{
15+
"type": "parallel",
16+
"data": {
17+
"commands": [
18+
{
19+
"type": "named",
20+
"data": {
21+
"name": "intake"
22+
}
23+
},
24+
{
25+
"type": "path",
26+
"data": {
27+
"pathName": "clean.source.race7"
28+
}
29+
}
30+
]
31+
}
32+
}
33+
]
34+
}
35+
},
36+
"folder": null,
37+
"choreoAuto": false
38+
}
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"version": 1.0,
3+
"startingPose": {
4+
"position": {
5+
"x": 1.3842846515935527,
6+
"y": 1.5341195874973776
7+
},
8+
"rotation": 0
9+
},
10+
"command": {
11+
"type": "sequential",
12+
"data": {
13+
"commands": [
14+
{
15+
"type": "parallel",
16+
"data": {
17+
"commands": [
18+
{
19+
"type": "path",
20+
"data": {
21+
"pathName": "clean.source.race8"
22+
}
23+
},
24+
{
25+
"type": "named",
26+
"data": {
27+
"name": "intake"
28+
}
29+
}
30+
]
31+
}
32+
},
33+
{
34+
"type": "parallel",
35+
"data": {
36+
"commands": [
37+
{
38+
"type": "named",
39+
"data": {
40+
"name": "shoot"
41+
}
42+
},
43+
{
44+
"type": "path",
45+
"data": {
46+
"pathName": "clean.mid.sweep"
47+
}
48+
}
49+
]
50+
}
51+
}
52+
]
53+
}
54+
},
55+
"folder": null,
56+
"choreoAuto": false
57+
}

Diff for: src/main/deploy/pathplanner/paths/clean.center.to1.path

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
},
99
"prevControl": null,
1010
"nextControl": {
11-
"x": 1.8962114847306633,
12-
"y": 6.452980598268889
11+
"x": 1.44283883432246,
12+
"y": 6.253586715447326
1313
},
1414
"isLocked": false,
1515
"linkedName": "center.subwoofer"
@@ -20,8 +20,8 @@
2020
"y": 6.8157068696448375
2121
},
2222
"prevControl": {
23-
"x": 1.9815373154284097,
24-
"y": 6.511225119454518
23+
"x": 1.618501382509183,
24+
"y": 6.218454205809981
2525
},
2626
"nextControl": null,
2727
"isLocked": false,
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"version": 1.0,
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 7.907220607593853,
7+
"y": 0.7846260485673593
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 8.574738290703399,
12+
"y": 1.1242403083950245
13+
},
14+
"isLocked": false,
15+
"linkedName": null
16+
},
17+
{
18+
"anchor": {
19+
"x": 8.352232396333552,
20+
"y": 5.785153253616065
21+
},
22+
"prevControl": {
23+
"x": 8.235124030875737,
24+
"y": 5.293298118693242
25+
},
26+
"nextControl": null,
27+
"isLocked": false,
28+
"linkedName": null
29+
}
30+
],
31+
"rotationTargets": [],
32+
"constraintZones": [],
33+
"eventMarkers": [],
34+
"globalConstraints": {
35+
"maxVelocity": 4.0,
36+
"maxAcceleration": 4.0,
37+
"maxAngularVelocity": 540.0,
38+
"maxAngularAcceleration": 720.0
39+
},
40+
"goalEndState": {
41+
"velocity": 0,
42+
"rotation": 51.115503566285454,
43+
"rotateFast": false
44+
},
45+
"reversed": false,
46+
"folder": null,
47+
"previewStartingState": {
48+
"rotation": 0,
49+
"velocity": 0
50+
},
51+
"useDefaultConstraints": true
52+
}
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"version": 1.0,
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 1.3842846515935527,
7+
"y": 1.5692520971347208
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 2.8012958736331157,
12+
"y": 1.4287220585853442
13+
},
14+
"isLocked": false,
15+
"linkedName": null
16+
},
17+
{
18+
"anchor": {
19+
"x": 8.094593992326358,
20+
"y": 2.3070347995189566
21+
},
22+
"prevControl": {
23+
"x": 7.005486193568678,
24+
"y": 1.8386013376876962
25+
},
26+
"nextControl": null,
27+
"isLocked": false,
28+
"linkedName": null
29+
}
30+
],
31+
"rotationTargets": [],
32+
"constraintZones": [],
33+
"eventMarkers": [],
34+
"globalConstraints": {
35+
"maxVelocity": 4.0,
36+
"maxAcceleration": 4.0,
37+
"maxAngularVelocity": 540.0,
38+
"maxAngularAcceleration": 720.0
39+
},
40+
"goalEndState": {
41+
"velocity": 0,
42+
"rotation": 24.676863170336997,
43+
"rotateFast": false
44+
},
45+
"reversed": false,
46+
"folder": null,
47+
"previewStartingState": {
48+
"rotation": 0,
49+
"velocity": 0
50+
},
51+
"useDefaultConstraints": true
52+
}
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"version": 1.0,
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 1.325730468864645,
7+
"y": 1.545830424043158
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 2.496814123442796,
12+
"y": 1.3350353662190912
13+
},
14+
"isLocked": false,
15+
"linkedName": null
16+
},
17+
{
18+
"anchor": {
19+
"x": 7.965774790322761,
20+
"y": 0.7846260485673593
21+
},
22+
"prevControl": {
23+
"x": 6.911799501202425,
24+
"y": 0.9134452505709579
25+
},
26+
"nextControl": null,
27+
"isLocked": false,
28+
"linkedName": null
29+
}
30+
],
31+
"rotationTargets": [],
32+
"constraintZones": [],
33+
"eventMarkers": [],
34+
"globalConstraints": {
35+
"maxVelocity": 4.0,
36+
"maxAcceleration": 4.0,
37+
"maxAngularVelocity": 540.0,
38+
"maxAngularAcceleration": 720.0
39+
},
40+
"goalEndState": {
41+
"velocity": 0,
42+
"rotation": 0,
43+
"rotateFast": false
44+
},
45+
"reversed": false,
46+
"folder": null,
47+
"previewStartingState": {
48+
"rotation": 0,
49+
"velocity": 0
50+
},
51+
"useDefaultConstraints": true
52+
}

Diff for: src/main/java/frc/robot/RobotContainer.java

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import frc.robot.shooter.Shooter;
1515
import frc.robot.superstructure.Superstructure;
1616
import frc.robot.superstructure.SuperstructureMechanism;
17+
import frc.robot.superstructure.SuperstructureState;
1718
import frc.robot.swerve.Swerve;
1819

1920
/** Initializes subsystems and commands. */
@@ -91,6 +92,10 @@ private void configureBindings() {
9192
operatorController.rightBumper().onTrue(superstructure.podium());
9293
operatorController.rightTrigger().onTrue(superstructure.subwoofer());
9394

95+
operatorController.povLeft().onTrue(superstructure.spool(SuperstructureState.SUBWOOFER_PRE));
96+
operatorController.povRight().onTrue(superstructure.spool(SuperstructureState.SUBWOOFER));
97+
operatorController.povUp().onTrue(superstructure.feed(SuperstructureState.SUBWOOFER));
98+
9499
operatorController.a().onTrue(superstructure.amp());
95100
operatorController.b().onTrue(superstructure.bloop());
96101
operatorController.x().onTrue(superstructure.stow());

Diff for: src/main/java/frc/robot/shooter/ShooterConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static class FlywheelConstants {
100100
public static final double MAXIMUM_SPEED = 60;
101101

102102
public static final SlewRateLimiter ACCELERATION_LIMITER =
103-
new SlewRateLimiter(MotionProfileCalculator.calculateAcceleration(MAXIMUM_SPEED, 0.25));
103+
new SlewRateLimiter(MotionProfileCalculator.calculateAcceleration(MAXIMUM_SPEED, 0.3));
104104

105105
public static final double TOLERANCE = 5;
106106
}

Diff for: src/main/java/frc/robot/shooter/ShooterState.java

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public record ShooterState(
1717

1818
public static final ShooterState EJECT = new ShooterState(0, SerializerConstants.EJECT_SPEED);
1919

20+
public static final ShooterState SUBWOOFER_PRE =
21+
new ShooterState(FlywheelConstants.SPEAKER_SPEED * 0.5, SerializerConstants.FAST_FEED_SPEED);
22+
2023
public static final ShooterState SUBWOOFER =
2124
new ShooterState(FlywheelConstants.SPEAKER_SPEED, SerializerConstants.FAST_FEED_SPEED);
2225

Diff for: src/main/java/frc/robot/superstructure/Superstructure.java

+11
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,15 @@ public Command eject() {
209209
.andThen(hold(SuperstructureState.EJECT))
210210
.withName("EJECT");
211211
}
212+
213+
public Command spool(SuperstructureState shot) {
214+
return pull(shot)
215+
.andThen(ready(shot));
216+
}
217+
218+
public Command feed(SuperstructureState shot) {
219+
return ready(shot)
220+
.andThen(Commands.waitSeconds(SuperstructureConstants.READY_PAUSE_DURATION))
221+
.andThen(hold(shot));
222+
}
212223
}

Diff for: src/main/java/frc/robot/superstructure/SuperstructureConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class SuperstructureConstants {
44

5-
public static final double PULL_DURATION = 0.15;
5+
public static final double PULL_DURATION = 0.2;
66

77
public static final double READY_DURATION = 1.0;
88

Diff for: src/main/java/frc/robot/superstructure/SuperstructureState.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ public record SuperstructureState(
2121
public static final SuperstructureState EJECT =
2222
new SuperstructureState(ArmState.EJECT, IntakeState.EJECT, ShooterState.EJECT);
2323

24-
public static final SuperstructureState SUBWOOFER =
25-
new SuperstructureState(ArmState.SUBWOOFER, IntakeState.IDLE, ShooterState.SUBWOOFER);
24+
public static final SuperstructureState SUBWOOFER_PRE =
25+
new SuperstructureState(ArmState.SUBWOOFER, IntakeState.IDLE, ShooterState.SUBWOOFER_PRE);
26+
27+
public static final SuperstructureState SUBWOOFER =
28+
new SuperstructureState(ArmState.SUBWOOFER, IntakeState.IDLE, ShooterState.SUBWOOFER);
2629

2730
public static final SuperstructureState PODIUM =
2831
new SuperstructureState(ArmState.PODIUM, IntakeState.IDLE, ShooterState.PODIUM);

Diff for: src/main/java/frc/robot/swerve/SteerMotorPIDF.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ public boolean atSetpoint() {
4141
public double calculate(Rotation2d measurement, Rotation2d setpoint) {
4242
double feedbackVolts = feedback.calculate(measurement.getRotations(), setpoint.getRotations());
4343

44-
double feedforwardVolts = feedforward.calculate(0.0);
44+
double feedforwardVolts = 0.0;
45+
46+
if (feedback.atSetpoint() == false) {
47+
if (measurement.getRadians() > setpoint.getRadians()) {
48+
feedforwardVolts = feedforward.ks;
49+
} else {
50+
feedforwardVolts = -feedforward.ks;
51+
}
52+
}
4553

4654
return feedbackVolts + feedforwardVolts;
4755
}

0 commit comments

Comments
 (0)