From 74009b86bbde67d814d16020ce4cec00b8267411 Mon Sep 17 00:00:00 2001 From: mimigamin Date: Sat, 4 Apr 2026 16:17:27 -0600 Subject: [PATCH] Fix defense drive --- .../pathplanner/autos/DriveShoot-Hori.auto | 2 +- ...ore.auto => LeftTrench-Neutral-Shoot.auto} | 24 ++- .../pathplanner/autos/ShootPreloadBump.auto | 2 +- .../deploy/pathplanner/autos/Test-LClimb.auto | 2 +- .../deploy/pathplanner/autos/Test-RClimb.auto | 2 +- .../autos/X. LeftTrench-Neutral-Shoot.auto | 22 +-- ...nch-Neutral-Shoot-PlayerStation-Shoot.auto | 79 ++++++++ .../pathplanner/paths/HubLeft-Shoot.path | 2 +- .../paths/LeftBump-Neutral-Shoot.path | 6 +- .../paths/LeftBump2-Neutral2-Shoot2.path | 22 ++- .../paths/LeftTrench-Neutral-Shoot.path | 10 +- .../paths/RightBump-Neutral-Shoot.path | 6 +- .../paths/RightBump2-Neutral2-Shoot2.path | 14 +- .../paths/RightTrench-Neutral-Shoot.path | 8 +- .../RightTrench-Neutral-Trench-Shoot.path | 173 ++++++++++++++++++ .../paths/ShotRight-PlayerStation.path | 95 ++++++++++ src/main/deploy/pathplanner/settings.json | 1 + .../java/frc4388/robot/RobotContainer.java | 2 +- 18 files changed, 415 insertions(+), 57 deletions(-) rename src/main/deploy/pathplanner/autos/{HubCenter-Score.auto => LeftTrench-Neutral-Shoot.auto} (57%) create mode 100644 src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Shoot-PlayerStation-Shoot.auto create mode 100644 src/main/deploy/pathplanner/paths/RightTrench-Neutral-Trench-Shoot.path create mode 100644 src/main/deploy/pathplanner/paths/ShotRight-PlayerStation.path diff --git a/src/main/deploy/pathplanner/autos/DriveShoot-Hori.auto b/src/main/deploy/pathplanner/autos/DriveShoot-Hori.auto index 8765ce9..a537fa2 100644 --- a/src/main/deploy/pathplanner/autos/DriveShoot-Hori.auto +++ b/src/main/deploy/pathplanner/autos/DriveShoot-Hori.auto @@ -39,6 +39,6 @@ } }, "resetOdom": true, - "folder": null, + "folder": "Spring Break Tests", "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/HubCenter-Score.auto b/src/main/deploy/pathplanner/autos/LeftTrench-Neutral-Shoot.auto similarity index 57% rename from src/main/deploy/pathplanner/autos/HubCenter-Score.auto rename to src/main/deploy/pathplanner/autos/LeftTrench-Neutral-Shoot.auto index 03bbe7f..35e60ec 100644 --- a/src/main/deploy/pathplanner/autos/HubCenter-Score.auto +++ b/src/main/deploy/pathplanner/autos/LeftTrench-Neutral-Shoot.auto @@ -13,13 +13,31 @@ { "type": "named", "data": { - "name": "Robot Rev Up" + "name": "Intake Reference" } }, { "type": "path", "data": { - "pathName": "Center-Hub-Shoot" + "pathName": "LeftTrench-Neutral-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "BumpOffsetBackward" + } + }, + { + "type": "path", + "data": { + "pathName": "LeftRamp-Shoot" } }, { @@ -32,6 +50,6 @@ } }, "resetOdom": true, - "folder": "Pikes Peak Autos", + "folder": null, "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/ShootPreloadBump.auto b/src/main/deploy/pathplanner/autos/ShootPreloadBump.auto index 43867c9..bc6176b 100644 --- a/src/main/deploy/pathplanner/autos/ShootPreloadBump.auto +++ b/src/main/deploy/pathplanner/autos/ShootPreloadBump.auto @@ -38,6 +38,6 @@ } }, "resetOdom": true, - "folder": null, + "folder": "Spring Break Tests", "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Test-LClimb.auto b/src/main/deploy/pathplanner/autos/Test-LClimb.auto index a78950c..d4084c8 100644 --- a/src/main/deploy/pathplanner/autos/Test-LClimb.auto +++ b/src/main/deploy/pathplanner/autos/Test-LClimb.auto @@ -38,6 +38,6 @@ } }, "resetOdom": true, - "folder": null, + "folder": "Spring Break Tests", "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Test-RClimb.auto b/src/main/deploy/pathplanner/autos/Test-RClimb.auto index fadd250..69de5c5 100644 --- a/src/main/deploy/pathplanner/autos/Test-RClimb.auto +++ b/src/main/deploy/pathplanner/autos/Test-RClimb.auto @@ -38,6 +38,6 @@ } }, "resetOdom": true, - "folder": null, + "folder": "Spring Break Tests", "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Shoot.auto b/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Shoot.auto index 35e60ec..03bbe7f 100644 --- a/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Shoot.auto +++ b/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Shoot.auto @@ -10,34 +10,16 @@ "name": "Intake Extended" } }, - { - "type": "named", - "data": { - "name": "Intake Reference" - } - }, - { - "type": "path", - "data": { - "pathName": "LeftTrench-Neutral-Shoot" - } - }, { "type": "named", "data": { "name": "Robot Rev Up" } }, - { - "type": "named", - "data": { - "name": "BumpOffsetBackward" - } - }, { "type": "path", "data": { - "pathName": "LeftRamp-Shoot" + "pathName": "Center-Hub-Shoot" } }, { @@ -50,6 +32,6 @@ } }, "resetOdom": true, - "folder": null, + "folder": "Pikes Peak Autos", "choreoAuto": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Shoot-PlayerStation-Shoot.auto b/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Shoot-PlayerStation-Shoot.auto new file mode 100644 index 0000000..99527fd --- /dev/null +++ b/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Shoot-PlayerStation-Shoot.auto @@ -0,0 +1,79 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "named", + "data": { + "name": "Intake Reference" + } + }, + { + "type": "path", + "data": { + "pathName": "RightTrench-Neutral-Trench-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "ShotRight-PlayerStation" + } + }, + { + "type": "wait", + "data": { + "waitTime": 2.0 + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "path", + "data": { + "pathName": "PlayerStation-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/HubLeft-Shoot.path b/src/main/deploy/pathplanner/paths/HubLeft-Shoot.path index d629e71..d9f96d5 100644 --- a/src/main/deploy/pathplanner/paths/HubLeft-Shoot.path +++ b/src/main/deploy/pathplanner/paths/HubLeft-Shoot.path @@ -33,7 +33,7 @@ "pointTowardsZones": [ { "fieldPosition": { - "x": 4.61155415, + "x": 4.612, "y": 4.0213534 }, "rotationOffset": 180.0, diff --git a/src/main/deploy/pathplanner/paths/LeftBump-Neutral-Shoot.path b/src/main/deploy/pathplanner/paths/LeftBump-Neutral-Shoot.path index e9c4794..3fbcef3 100644 --- a/src/main/deploy/pathplanner/paths/LeftBump-Neutral-Shoot.path +++ b/src/main/deploy/pathplanner/paths/LeftBump-Neutral-Shoot.path @@ -79,7 +79,7 @@ "rotationTargets": [ { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": 112.5 + "rotationDegrees": 22.5 } ], "constraintZones": [], @@ -99,7 +99,7 @@ "x": 7.0, "y": 0.0 }, - "rotationOffset": 180.0, + "rotationOffset": 100.0, "minWaypointRelativePos": 2.4983388704318887, "maxWaypointRelativePos": 3.2956810631229274, "name": "Point Towards Zone" @@ -116,7 +116,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": 113.07 + "rotation": 23.07 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/LeftBump2-Neutral2-Shoot2.path b/src/main/deploy/pathplanner/paths/LeftBump2-Neutral2-Shoot2.path index 0b4fcc4..2a51bc4 100644 --- a/src/main/deploy/pathplanner/paths/LeftBump2-Neutral2-Shoot2.path +++ b/src/main/deploy/pathplanner/paths/LeftBump2-Neutral2-Shoot2.path @@ -36,8 +36,8 @@ "y": 4.128025641025641 }, "prevControl": { - "x": 7.182601673147601, - "y": 3.9168984964132223 + "x": 7.1826016731476, + "y": 3.9168984964132205 }, "nextControl": { "x": 7.618820512820513, @@ -79,7 +79,7 @@ "rotationTargets": [ { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": 112.5 + "rotationDegrees": 22.5 } ], "constraintZones": [], @@ -110,8 +110,18 @@ "y": 8.0 }, "rotationOffset": 0.0, - "minWaypointRelativePos": 2.1085271317829366, - "maxWaypointRelativePos": 3.1893687707641063, + "minWaypointRelativePos": 1.8870431893687745, + "maxWaypointRelativePos": 2.2768549280177193, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 12.0, + "y": 8.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 2.5603543743078774, + "maxWaypointRelativePos": 3.0121816168327573, "name": "Point Towards Zone" } ], @@ -126,7 +136,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": 113.07 + "rotation": 23.069999999999993 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/LeftTrench-Neutral-Shoot.path b/src/main/deploy/pathplanner/paths/LeftTrench-Neutral-Shoot.path index 8705985..e542fc6 100644 --- a/src/main/deploy/pathplanner/paths/LeftTrench-Neutral-Shoot.path +++ b/src/main/deploy/pathplanner/paths/LeftTrench-Neutral-Shoot.path @@ -79,7 +79,7 @@ "rotationTargets": [ { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": 112.5 + "rotationDegrees": 22.5 } ], "constraintZones": [ @@ -110,10 +110,10 @@ }, { "fieldPosition": { - "x": 7.0, - "y": 0.0 + "x": 8.0, + "y": 7.0 }, - "rotationOffset": 180.0, + "rotationOffset": 0.0, "minWaypointRelativePos": 2.4983388704318887, "maxWaypointRelativePos": 3.2956810631229274, "name": "Point Towards Zone" @@ -140,7 +140,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": 101.70667085951649 + "rotation": 11.706999999999994 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/RightBump-Neutral-Shoot.path b/src/main/deploy/pathplanner/paths/RightBump-Neutral-Shoot.path index 3ef4b90..eaedae9 100644 --- a/src/main/deploy/pathplanner/paths/RightBump-Neutral-Shoot.path +++ b/src/main/deploy/pathplanner/paths/RightBump-Neutral-Shoot.path @@ -79,7 +79,7 @@ "rotationTargets": [ { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": -112.5 + "rotationDegrees": -22.5 } ], "constraintZones": [], @@ -99,7 +99,7 @@ "x": 7.0, "y": 8.0 }, - "rotationOffset": 180.0, + "rotationOffset": -100.0, "minWaypointRelativePos": 2.4983388704318887, "maxWaypointRelativePos": 3.2956810631229274, "name": "Point Towards Zone" @@ -116,7 +116,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": -113.07 + "rotation": -23.069999999999993 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/RightBump2-Neutral2-Shoot2.path b/src/main/deploy/pathplanner/paths/RightBump2-Neutral2-Shoot2.path index 0db3ed6..9ec72f2 100644 --- a/src/main/deploy/pathplanner/paths/RightBump2-Neutral2-Shoot2.path +++ b/src/main/deploy/pathplanner/paths/RightBump2-Neutral2-Shoot2.path @@ -9,7 +9,7 @@ "prevControl": null, "nextControl": { "x": 6.049027667109173, - "y": 2.2620000015309394 + "y": 2.2620000015309376 }, "isLocked": false, "linkedName": null @@ -36,8 +36,8 @@ "y": 4.267564102564102 }, "prevControl": { - "x": 7.209222795856496, - "y": 4.455023566405373 + "x": 7.209222795856494, + "y": 4.455023566405375 }, "nextControl": { "x": 7.549051282051284, @@ -68,7 +68,7 @@ "y": 2.5119999999999996 }, "prevControl": { - "x": 3.6429272202047827, + "x": 3.642927220204783, "y": 2.5610290337845445 }, "nextControl": null, @@ -83,7 +83,7 @@ }, { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": -112.5 + "rotationDegrees": -22.5 } ], "constraintZones": [], @@ -115,7 +115,7 @@ }, "rotationOffset": 0.0, "minWaypointRelativePos": 2.1085271317829366, - "maxWaypointRelativePos": 3.1893687707641063, + "maxWaypointRelativePos": 3.1539313399778472, "name": "Point Towards Zone" } ], @@ -130,7 +130,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": -113.07 + "rotation": -23.069999999999993 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Shoot.path b/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Shoot.path index 0c80fd9..11468c2 100644 --- a/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Shoot.path +++ b/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Shoot.path @@ -79,7 +79,7 @@ "rotationTargets": [ { "waypointRelativePos": 3.4736842105263164, - "rotationDegrees": -112.5 + "rotationDegrees": -22.5 } ], "constraintZones": [ @@ -123,8 +123,8 @@ }, { "fieldPosition": { - "x": 7.0, - "y": 8.0 + "x": 0.0, + "y": 5.0 }, "rotationOffset": 180.0, "minWaypointRelativePos": 2.4983388704318887, @@ -153,7 +153,7 @@ }, "goalEndState": { "velocity": 3.0, - "rotation": -113.07 + "rotation": -23.07 }, "reversed": false, "folder": null, diff --git a/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Trench-Shoot.path b/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Trench-Shoot.path new file mode 100644 index 0000000..ff04591 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/RightTrench-Neutral-Trench-Shoot.path @@ -0,0 +1,173 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6070897435897447, + "y": 0.6046794871794885 + }, + "prevControl": null, + "nextControl": { + "x": 4.115752584653353, + "y": 0.5635297641960387 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.595564102564104, + "y": 0.9884102564102579 + }, + "prevControl": { + "x": 7.392948649818514, + "y": 0.7987129676949314 + }, + "nextControl": { + "x": 7.9699166450787695, + "y": 1.3388951842695742 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.793243589743589, + "y": 3.4070769230769233 + }, + "prevControl": { + "x": 7.776404526227516, + "y": 3.6565091702702275 + }, + "nextControl": { + "x": 7.842718812250754, + "y": 2.674214557033146 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.4211410256410275, + "y": 0.9884102564102579 + }, + "prevControl": { + "x": 7.693106679552213, + "y": 1.2858726903756175 + }, + "nextControl": { + "x": 7.049038461538463, + "y": 0.5814230769230777 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.711743589743591, + "y": 0.6046794871794885 + }, + "prevControl": { + "x": 3.995405188035349, + "y": 0.5680757693806849 + }, + "nextControl": { + "x": 3.4637993695130525, + "y": 0.6366742313458394 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.4442692307692324, + "y": 1.302 + }, + "prevControl": { + "x": 2.7301802034615954, + "y": 1.1693945129031929 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0, + "maxWaypointRelativePos": 5.0, + "constraints": { + "maxVelocity": 1.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 7.0, + "y": 8.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 1.3067552602436252, + "maxWaypointRelativePos": 2.015503875969026, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.0, + "y": 0.6 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.6910299003322272, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.0, + "y": 0.7 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 2.5913621262458837, + "maxWaypointRelativePos": 4.352159468438559, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 4.612, + "y": 4.021 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 4.529346622369888, + "maxWaypointRelativePos": 5.0, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 3.0, + "rotation": -145.9260531715447 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.3, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/ShotRight-PlayerStation.path b/src/main/deploy/pathplanner/paths/ShotRight-PlayerStation.path new file mode 100644 index 0000000..96e1e1b --- /dev/null +++ b/src/main/deploy/pathplanner/paths/ShotRight-PlayerStation.path @@ -0,0 +1,95 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.444, + "y": 1.302 + }, + "prevControl": null, + "nextControl": { + "x": 2.2968028935074876, + "y": 1.0999282012743195 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.5754761904761914, + "y": 1.0 + }, + "prevControl": { + "x": 2.2272563574654534, + "y": 0.9727386663284083 + }, + "nextControl": { + "x": 0.9236960234869294, + "y": 1.0272613336715914 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.325, + "y": 0.95 + }, + "prevControl": { + "x": 0.5747421350529089, + "y": 0.9386480847776856 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0, + "maxWaypointRelativePos": 2.0, + "constraints": { + "maxVelocity": 1.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 10.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 0.0, + "y": 0.7 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.6, + "maxWaypointRelativePos": 1.0956834532374118, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -95.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -149.42767342080234 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/settings.json b/src/main/deploy/pathplanner/settings.json index e97d336..6f1e894 100644 --- a/src/main/deploy/pathplanner/settings.json +++ b/src/main/deploy/pathplanner/settings.json @@ -4,6 +4,7 @@ "holonomicMode": true, "pathFolders": [], "autoFolders": [ + "Spring Break Tests", "Pikes Peak Autos" ], "defaultMaxVel": 3.0, diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index f68c56d..fa57d0b 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -265,7 +265,7 @@ public class RobotContainer { // TEST-> the driver is holding the left trigger, drive slow and rotation up new Trigger(() -> getDeadbandedDriverController().getLeftTriggerAxis() >= 0.5) .onTrue(new InstantCommand(() -> { - m_robotSwerveDrive.setPercentOutput(0.1); + m_robotSwerveDrive.setPercentOutput(0.10); m_robotSwerveDrive.shiftUpRot(); })) .onFalse(new InstantCommand(() -> {