Skip to content

Commit 6567079

Browse files
Second working J sweep prototype
1 parent 4f636c4 commit 6567079

10 files changed

Lines changed: 348 additions & 12 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"version": "2025.0",
3+
"command": {
4+
"type": "sequential",
5+
"data": {
6+
"commands": [
7+
{
8+
"type": "parallel",
9+
"data": {
10+
"commands": [
11+
{
12+
"type": "sequential",
13+
"data": {
14+
"commands": [
15+
{
16+
"type": "parallel",
17+
"data": {
18+
"commands": [
19+
{
20+
"type": "path",
21+
"data": {
22+
"pathName": "Left Sweep Out"
23+
}
24+
},
25+
{
26+
"type": "sequential",
27+
"data": {
28+
"commands": [
29+
{
30+
"type": "wait",
31+
"data": {
32+
"waitTime": 0.5
33+
}
34+
},
35+
{
36+
"type": "named",
37+
"data": {
38+
"name": "StartIntake"
39+
}
40+
}
41+
]
42+
}
43+
}
44+
]
45+
}
46+
},
47+
{
48+
"type": "path",
49+
"data": {
50+
"pathName": "Left Sweep In"
51+
}
52+
},
53+
{
54+
"type": "named",
55+
"data": {
56+
"name": "LaunchInPlaceAgitate"
57+
}
58+
},
59+
{
60+
"type": "path",
61+
"data": {
62+
"pathName": "Left Sweep Reset"
63+
}
64+
}
65+
]
66+
}
67+
}
68+
]
69+
}
70+
}
71+
]
72+
}
73+
},
74+
"resetOdom": true,
75+
"folder": "Sweep Only",
76+
"choreoAuto": false
77+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"version": "2025.0",
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 7.75,
7+
"y": 5.0
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 7.854085753117357,
12+
"y": 6.052592047210485
13+
},
14+
"isLocked": false,
15+
"linkedName": "Left Sweep Middle"
16+
},
17+
{
18+
"anchor": {
19+
"x": 6.587132530120481,
20+
"y": 7.247746987951807
21+
},
22+
"prevControl": {
23+
"x": 7.353455688202985,
24+
"y": 6.838052023726868
25+
},
26+
"nextControl": {
27+
"x": 6.111103420747049,
28+
"y": 7.502243706311167
29+
},
30+
"isLocked": false,
31+
"linkedName": null
32+
},
33+
{
34+
"anchor": {
35+
"x": 4.0,
36+
"y": 7.4
37+
},
38+
"prevControl": {
39+
"x": 4.280798723515542,
40+
"y": 7.412193190735794
41+
},
42+
"nextControl": {
43+
"x": 3.7502353644396926,
44+
"y": 7.38915440995488
45+
},
46+
"isLocked": false,
47+
"linkedName": "Left Sweep Start"
48+
},
49+
{
50+
"anchor": {
51+
"x": 3.155831325301205,
52+
"y": 7.247746987951807
53+
},
54+
"prevControl": {
55+
"x": 3.363434455269518,
56+
"y": 7.408267990390196
57+
},
58+
"nextControl": {
59+
"x": 2.9580563617354465,
60+
"y": 7.094825230877927
61+
},
62+
"isLocked": false,
63+
"linkedName": null
64+
},
65+
{
66+
"anchor": {
67+
"x": 3.0465542168674697,
68+
"y": 6.056626506024097
69+
},
70+
"prevControl": {
71+
"x": 3.4425549647993225,
72+
"y": 7.698552544225509
73+
},
74+
"nextControl": null,
75+
"isLocked": false,
76+
"linkedName": "Left Sweep End"
77+
}
78+
],
79+
"rotationTargets": [
80+
{
81+
"waypointRelativePos": 1.0,
82+
"rotationDegrees": 0.0
83+
}
84+
],
85+
"constraintZones": [],
86+
"pointTowardsZones": [],
87+
"eventMarkers": [],
88+
"globalConstraints": {
89+
"maxVelocity": 3.0,
90+
"maxAcceleration": 3.0,
91+
"maxAngularVelocity": 540.0,
92+
"maxAngularAcceleration": 720.0,
93+
"nominalVoltage": 12.0,
94+
"unlimited": false
95+
},
96+
"goalEndState": {
97+
"velocity": 0,
98+
"rotation": 0.0
99+
},
100+
"reversed": false,
101+
"folder": "Secondary",
102+
"idealStartingState": {
103+
"velocity": 0,
104+
"rotation": -90.0
105+
},
106+
"useDefaultConstraints": true
107+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"version": "2025.0",
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 4.0,
7+
"y": 7.4
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 5.087900888173833,
12+
"y": 7.277157840614658
13+
},
14+
"isLocked": false,
15+
"linkedName": "Left Sweep Start"
16+
},
17+
{
18+
"anchor": {
19+
"x": 7.220939759036145,
20+
"y": 7.269602409638554
21+
},
22+
"prevControl": {
23+
"x": 6.725670446843524,
24+
"y": 7.620199071260089
25+
},
26+
"nextControl": {
27+
"x": 7.542616085851799,
28+
"y": 7.041890650545384
29+
},
30+
"isLocked": false,
31+
"linkedName": null
32+
},
33+
{
34+
"anchor": {
35+
"x": 7.75,
36+
"y": 6.111
37+
},
38+
"prevControl": {
39+
"x": 7.596106475234765,
40+
"y": 6.827514787943704
41+
},
42+
"nextControl": {
43+
"x": 7.802497934471371,
44+
"y": 5.866574209879072
45+
},
46+
"isLocked": false,
47+
"linkedName": null
48+
},
49+
{
50+
"anchor": {
51+
"x": 7.75,
52+
"y": 5.0
53+
},
54+
"prevControl": {
55+
"x": 7.7743116211986765,
56+
"y": 5.24881508208847
57+
},
58+
"nextControl": null,
59+
"isLocked": false,
60+
"linkedName": "Left Sweep Middle"
61+
}
62+
],
63+
"rotationTargets": [
64+
{
65+
"waypointRelativePos": 0.5,
66+
"rotationDegrees": 0.0
67+
},
68+
{
69+
"waypointRelativePos": 1.5,
70+
"rotationDegrees": -90.0
71+
}
72+
],
73+
"constraintZones": [],
74+
"pointTowardsZones": [],
75+
"eventMarkers": [],
76+
"globalConstraints": {
77+
"maxVelocity": 3.0,
78+
"maxAcceleration": 3.0,
79+
"maxAngularVelocity": 540.0,
80+
"maxAngularAcceleration": 720.0,
81+
"nominalVoltage": 12.0,
82+
"unlimited": false
83+
},
84+
"goalEndState": {
85+
"velocity": 0,
86+
"rotation": -90.0
87+
},
88+
"reversed": false,
89+
"folder": "Secondary",
90+
"idealStartingState": {
91+
"velocity": 0,
92+
"rotation": 0.0
93+
},
94+
"useDefaultConstraints": true
95+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"version": "2025.0",
3+
"waypoints": [
4+
{
5+
"anchor": {
6+
"x": 3.0465542168674697,
7+
"y": 6.056626506024097
8+
},
9+
"prevControl": null,
10+
"nextControl": {
11+
"x": 2.9649322188572373,
12+
"y": 7.429825772894727
13+
},
14+
"isLocked": false,
15+
"linkedName": "Left Sweep End"
16+
},
17+
{
18+
"anchor": {
19+
"x": 4.0,
20+
"y": 7.4
21+
},
22+
"prevControl": {
23+
"x": 2.86078313253012,
24+
"y": 7.44444578313253
25+
},
26+
"nextControl": null,
27+
"isLocked": false,
28+
"linkedName": "Left Sweep Start"
29+
}
30+
],
31+
"rotationTargets": [],
32+
"constraintZones": [],
33+
"pointTowardsZones": [],
34+
"eventMarkers": [],
35+
"globalConstraints": {
36+
"maxVelocity": 3.0,
37+
"maxAcceleration": 3.0,
38+
"maxAngularVelocity": 540.0,
39+
"maxAngularAcceleration": 720.0,
40+
"nominalVoltage": 12.0,
41+
"unlimited": false
42+
},
43+
"goalEndState": {
44+
"velocity": 0,
45+
"rotation": 0.0
46+
},
47+
"reversed": false,
48+
"folder": "Secondary",
49+
"idealStartingState": {
50+
"velocity": 0,
51+
"rotation": 0.0
52+
},
53+
"useDefaultConstraints": true
54+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@ private void registerNamedCommands() {
624624

625625
// Launcher commands
626626
namedCommands.put("PrimeToLaunch", LaunchCommands.primeToLaunch(drive, launcher));
627-
namedCommands.put("LaunchInPlace", LaunchCommands.launchInPlace(drive, vision, launcher, hopper));
627+
namedCommands.put("LaunchInPlace", LaunchCommands.launchInPlace(drive, vision, launcher, hopper, 0));
628+
namedCommands.put(
629+
"LaunchInPlaceAgitate",
630+
new StagedAgitateFeed(intake).withDeadline(LaunchCommands.launchInPlace(drive, vision, launcher, hopper, 2)));
628631

629632
// Hang commands
630633
namedCommands.put("HangUp", Commands.none());

src/main/java/frc/robot/commands/LaunchCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static Command primeToLaunch(Drive drive, Launcher launcher) {
5454
}));
5555
}
5656

57-
public static Command launchInPlace(Drive drive, AprilTagVision vision, Launcher launcher, Hopper hopper) {
57+
public static Command launchInPlace(Drive drive, AprilTagVision vision, Launcher launcher, Hopper hopper, double withExtraTime) {
5858
Debouncer alignedWithHubDebouncer = new Debouncer(1);
5959
BooleanSupplier isAligned = () -> alignedWithHubDebouncer.calculate((MathUtil.isNear(
6060
LaunchCalculator.getInstance()
@@ -74,7 +74,7 @@ public static Command launchInPlace(Drive drive, AprilTagVision vision, Launcher
7474
Commands.waitUntil(launcher::isReadyDebounced).withTimeout(1),
7575
hopper.runOnce(() -> hopper.setMode(HopperRunMode.FIRING))));
7676

77-
return Commands.parallel(launchFuel, autoAlign, Commands.waitSeconds(3))
77+
return Commands.parallel(launchFuel, autoAlign, Commands.waitSeconds(3 + withExtraTime))
7878
.finallyDo((interrupted) -> {
7979
hopper.setMode(HopperRunMode.STOPPED);
8080
launcher.stop();

src/main/java/frc/robot/subsystems/hopper/HopperConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public record MotorConstants(
1010
int deviceId, double gearRatio, boolean inverted, boolean brakeMode, double stallCurrent) {}
1111

1212
public static final MotorConstants FEEDER_CONSTANTS =
13-
new MotorConstants(14, (1.0 / 3.0) * (1.0 / 3.0), true, false, 30);
13+
new MotorConstants(14, (1.0 / 3.0) * (1.0 / 3.0), true, false, 120);
1414
public static final MotorConstants LIFTER_CONSTANTS =
1515
new MotorConstants(5, (1.0 / 3.0) * (1.0 / 3.0) * (1.0 / 3.0), true, false, 40);
1616

src/main/java/frc/robot/subsystems/hopper/HopperMotorIOSparkMax.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public HopperMotorIOSparkMax(MotorConstants constants) {
5656

5757
@Override
5858
public void updateInputs(HopperMotorIOInputs inputs) {
59-
6059
SparkUtil.clearError();
6160
ifOk(motor, relativeEncoder::getPosition, value -> inputs.positionRad = Units.rotationsToRadians(value));
6261
ifOk(

0 commit comments

Comments
 (0)