diff --git a/src/main/deploy/pathplanner/autos/CLB_Citrus_V2.auto b/src/main/deploy/pathplanner/autos/CLB_Citrus_V2.auto new file mode 100644 index 0000000..0f98a38 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/CLB_Citrus_V2.auto @@ -0,0 +1,204 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "toggleWarm" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "CLB_Entry" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "CLB_Intake_V2" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "CLB_StageShoot1_V2" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + }, + { + "type": "named", + "data": { + "name": "flywheelLayup" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "toggleHub" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 5.0 + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + }, + { + "type": "named", + "data": { + "name": "pivotShake" + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "Citrus Auto", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Force Warmup.auto b/src/main/deploy/pathplanner/autos/Force Warmup.auto new file mode 100644 index 0000000..a15c30b --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Force Warmup.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Force Warmup" + } + } + ] + } + }, + "resetOdom": false, + "folder": "Force Warmup", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/JustAim.auto b/src/main/deploy/pathplanner/autos/JustAim.auto new file mode 100644 index 0000000..1cc468e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/JustAim.auto @@ -0,0 +1,25 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "toggleHub" + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + } + ] + } + }, + "resetOdom": false, + "folder": "TestingSpartan", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/JustConstraint.auto b/src/main/deploy/pathplanner/autos/JustConstraint.auto new file mode 100644 index 0000000..7473c45 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/JustConstraint.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "JustConstraint" + } + } + ] + } + }, + "resetOdom": false, + "folder": "TestingSpartan", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/JustKick.auto b/src/main/deploy/pathplanner/autos/JustKick.auto new file mode 100644 index 0000000..043497e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/JustKick.auto @@ -0,0 +1,56 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 10.0 + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + }, + { + "type": "named", + "data": { + "name": "flywheelLayup" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "TestingSpartan", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Static Shoot Preload.auto b/src/main/deploy/pathplanner/autos/Static Shoot Preload.auto index 9154942..ce260be 100644 --- a/src/main/deploy/pathplanner/autos/Static Shoot Preload.auto +++ b/src/main/deploy/pathplanner/autos/Static Shoot Preload.auto @@ -16,6 +16,12 @@ "pathName": "CenterBackout" } }, + { + "type": "named", + "data": { + "name": "toggleHub" + } + }, { "type": "race", "data": { @@ -29,13 +35,13 @@ { "type": "named", "data": { - "name": "flywheelLayup" + "name": "flywheelDynamic" } }, { "type": "named", "data": { - "name": "hoodLayup" + "name": "hoodDynamic" } } ] @@ -48,13 +54,13 @@ { "type": "named", "data": { - "name": "flywheelLayup" + "name": "flywheelDynamic" } }, { "type": "named", "data": { - "name": "hoodLayup" + "name": "hoodDynamic" } }, { diff --git a/src/main/deploy/pathplanner/autos/[Left Swiper Visual].auto b/src/main/deploy/pathplanner/autos/[Left Swiper Visual].auto new file mode 100644 index 0000000..52a2b16 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Left Swiper Visual].auto @@ -0,0 +1,37 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Entry 1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Intake 1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Left Swipe] StageShoot1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Reentry 1" + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Left] Double Swipe", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Left] Bump Disrupt.auto b/src/main/deploy/pathplanner/autos/[Left] Bump Disrupt.auto new file mode 100644 index 0000000..cfe2522 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Left] Bump Disrupt.auto @@ -0,0 +1,57 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Left Bump Disrupt Entry" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "pivotUp" + } + }, + { + "type": "path", + "data": { + "pathName": "Left Bump Disrupt Block" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Left] Bump Disrupt", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Left] Double Swipe.auto b/src/main/deploy/pathplanner/autos/[Left] Double Swipe.auto new file mode 100644 index 0000000..263fa32 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Left] Double Swipe.auto @@ -0,0 +1,402 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "toggleWarm" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Entry 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Intake 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] StageShoot1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "toggleHub" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 4.0 + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "pivotShake" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Reentry 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] Intake 2" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Left Swipe] StageShoot2" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "wait", + "data": { + "waitTime": 5.0 + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "pivotShake" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Left] Double Swipe", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Right] Bump Disrupt.auto b/src/main/deploy/pathplanner/autos/[Right] Bump Disrupt.auto new file mode 100644 index 0000000..099198e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Right] Bump Disrupt.auto @@ -0,0 +1,57 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Right Bump Disrupt Entry" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "pivotUp" + } + }, + { + "type": "path", + "data": { + "pathName": "Right Bump Disrupt Block" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Right] Bump Disrupt", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Right] Bump.auto b/src/main/deploy/pathplanner/autos/[Right] Bump.auto new file mode 100644 index 0000000..723eebf --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Right] Bump.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "crossBumpAllianceZone" + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Right] Bump", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Right] Double Swipe Visualizer.auto b/src/main/deploy/pathplanner/autos/[Right] Double Swipe Visualizer.auto new file mode 100644 index 0000000..43fcb1f --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Right] Double Swipe Visualizer.auto @@ -0,0 +1,49 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Entry 1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Intake 1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Right Swipe] StageShoot1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Reentry 1" + } + }, + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Intake 2" + } + }, + { + "type": "path", + "data": { + "pathName": "[Right Swipe] StageShoot2" + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Right] Double Swipe", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/[Right] Double Swipe.auto b/src/main/deploy/pathplanner/autos/[Right] Double Swipe.auto new file mode 100644 index 0000000..524cd71 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/[Right] Double Swipe.auto @@ -0,0 +1,438 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "toggleWarm" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 0.75 + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Entry 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Intake 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] StageShoot1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "flywheelLayup" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "toggleHub" + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.25 + } + }, + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "named", + "data": { + "name": "pivotShake" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Reentry 1" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "hoodLayup" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] Intake 2" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "[Right Swipe] StageShoot2" + } + }, + { + "type": "named", + "data": { + "name": "pivotDown" + } + }, + { + "type": "named", + "data": { + "name": "rollerIntake" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIntake" + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + } + ] + } + }, + { + "type": "race", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "driveHubLock" + } + }, + { + "type": "wait", + "data": { + "waitTime": 3.5 + } + }, + { + "type": "named", + "data": { + "name": "flywheelDynamic" + } + }, + { + "type": "named", + "data": { + "name": "hoodDynamic" + } + }, + { + "type": "named", + "data": { + "name": "kickerIndex" + } + }, + { + "type": "named", + "data": { + "name": "agitatorIndex" + } + }, + { + "type": "named", + "data": { + "name": "indexerIndex" + } + }, + { + "type": "named", + "data": { + "name": "pivotShake" + } + } + ] + } + } + ] + } + }, + "resetOdom": false, + "folder": "[Right] Double Swipe", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/CLB_Entry.path b/src/main/deploy/pathplanner/paths/CLB_Entry.path index 952286d..3d59e6f 100644 --- a/src/main/deploy/pathplanner/paths/CLB_Entry.path +++ b/src/main/deploy/pathplanner/paths/CLB_Entry.path @@ -62,7 +62,7 @@ "unlimited": false }, "goalEndState": { - "velocity": 2.0, + "velocity": 0.5, "rotation": -107.64200000000001 }, "reversed": false, diff --git a/src/main/deploy/pathplanner/paths/CLB_Intake.path b/src/main/deploy/pathplanner/paths/CLB_Intake.path index 6867b3b..1d1efb8 100644 --- a/src/main/deploy/pathplanner/paths/CLB_Intake.path +++ b/src/main/deploy/pathplanner/paths/CLB_Intake.path @@ -53,8 +53,8 @@ "constraintZones": [ { "name": "Constraints Zone", - "minWaypointRelativePos": 0.811910669975181, - "maxWaypointRelativePos": 0.3513647642680001, + "minWaypointRelativePos": 1.1505739365293643, + "maxWaypointRelativePos": 0.2808912896691613, "constraints": { "maxVelocity": 1.0, "maxAcceleration": 3.0, diff --git a/src/main/deploy/pathplanner/paths/CLB_Intake_V2.path b/src/main/deploy/pathplanner/paths/CLB_Intake_V2.path new file mode 100644 index 0000000..a567993 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/CLB_Intake_V2.path @@ -0,0 +1,105 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 8.13, + "y": 7.017 + }, + "prevControl": null, + "nextControl": { + "x": 8.126000184885955, + "y": 6.575320550590469 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.13, + "y": 5.054753442150735 + }, + "prevControl": { + "x": 8.157996058825054, + "y": 5.354131000583097 + }, + "nextControl": { + "x": 8.09464321482716, + "y": 4.676663508663737 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.846747503566333, + "y": 5.607 + }, + "prevControl": { + "x": 7.198343383255684, + "y": 5.160743691163518 + }, + "nextControl": { + "x": 6.510342368045648, + "y": 6.0339757489301 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.342, + "y": 7.37 + }, + "prevControl": { + "x": 6.445509272467903, + "y": 6.771526390870186 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.854771784232354, + "rotationDegrees": -110.0 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.3305210918114133, + "maxWaypointRelativePos": 1.3548387096774213, + "constraints": { + "maxVelocity": 0.5, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "CLB Citrus Auto", + "idealStartingState": { + "velocity": 0.5, + "rotation": -107.64200000000001 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/CLB_StageShoot1_V2.path b/src/main/deploy/pathplanner/paths/CLB_StageShoot1_V2.path new file mode 100644 index 0000000..b1c516c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/CLB_StageShoot1_V2.path @@ -0,0 +1,59 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.342, + "y": 7.37 + }, + "prevControl": null, + "nextControl": { + "x": 5.099155940801128, + "y": 7.402306101453735 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.1800082843706226, + "y": 7.37 + }, + "prevControl": { + "x": 3.5462722834950475, + "y": 7.420690225765222 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.9609958506224051, + "rotationDegrees": 180.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 179.51226418354418 + }, + "reversed": false, + "folder": "CLB Citrus Auto", + "idealStartingState": { + "velocity": 0.0, + "rotation": 180.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/CLB_TrenchShoot.path b/src/main/deploy/pathplanner/paths/CLB_TrenchShoot.path index ee4c07b..483775b 100644 --- a/src/main/deploy/pathplanner/paths/CLB_TrenchShoot.path +++ b/src/main/deploy/pathplanner/paths/CLB_TrenchShoot.path @@ -61,7 +61,7 @@ "rotation": -29.999999999999996 }, "reversed": false, - "folder": "Josh", + "folder": "Misc", "idealStartingState": { "velocity": 0, "rotation": 0.0 diff --git a/src/main/deploy/pathplanner/paths/CLR_Intake.path b/src/main/deploy/pathplanner/paths/CLR_Intake.path index 6dbda4a..7cc8d8f 100644 --- a/src/main/deploy/pathplanner/paths/CLR_Intake.path +++ b/src/main/deploy/pathplanner/paths/CLR_Intake.path @@ -21,7 +21,7 @@ }, "prevControl": { "x": 8.01254981548159, - "y": 2.7933775898403677 + "y": 2.793377589840365 }, "nextControl": { "x": 7.820769955384298, diff --git a/src/main/deploy/pathplanner/paths/Copy of CLB_Intake.path b/src/main/deploy/pathplanner/paths/Copy of CLB_Intake.path index eaaab47..5ac52fb 100644 --- a/src/main/deploy/pathplanner/paths/Copy of CLB_Intake.path +++ b/src/main/deploy/pathplanner/paths/Copy of CLB_Intake.path @@ -112,7 +112,7 @@ "rotation": 0.0 }, "reversed": false, - "folder": "Josh", + "folder": "Misc", "idealStartingState": { "velocity": 2.0, "rotation": -107.64200000000001 diff --git a/src/main/deploy/pathplanner/paths/Force Warmup.path b/src/main/deploy/pathplanner/paths/Force Warmup.path new file mode 100644 index 0000000..600e861 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Force Warmup.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.0, + "y": 7.0 + }, + "prevControl": null, + "nextControl": { + "x": 3.0, + "y": 7.0 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.3144935805991436, + "y": 7.0 + }, + "prevControl": { + "x": 2.3144935805991436, + "y": 7.0 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": "Force Warmup", + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/JustConstraint.path b/src/main/deploy/pathplanner/paths/JustConstraint.path new file mode 100644 index 0000000..114277e --- /dev/null +++ b/src/main/deploy/pathplanner/paths/JustConstraint.path @@ -0,0 +1,68 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.959202247191011, + "y": 7.3572696629213485 + }, + "prevControl": null, + "nextControl": { + "x": 4.959202247191014, + "y": 7.3572696629213485 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.239426966292136, + "y": 7.3572696629213485 + }, + "prevControl": { + "x": 7.239426966292136, + "y": 7.3572696629213485 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.1498759305210926, + "maxWaypointRelativePos": 0.5687344913151384, + "constraints": { + "maxVelocity": 0.1, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": "Testing", + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Left Bump Disrupt Block.path b/src/main/deploy/pathplanner/paths/Left Bump Disrupt Block.path new file mode 100644 index 0000000..34c841d --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Left Bump Disrupt Block.path @@ -0,0 +1,79 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.264507845935014, + "y": 7.276134094155207 + }, + "prevControl": null, + "nextControl": { + "x": 7.0373344200118195, + "y": 7.290847159455852 + }, + "isLocked": false, + "linkedName": "[Left Bump Disrupt] Entry" + }, + { + "anchor": { + "x": 8.153552068474243, + "y": 6.616262482172326 + }, + "prevControl": { + "x": 8.048357809895414, + "y": 6.928791486051591 + }, + "nextControl": { + "x": 8.245845591456037, + "y": 6.342061178872171 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.153552068474243, + "y": 5.225609814878692 + }, + "prevControl": { + "x": 8.153552068474243, + "y": 6.0411559832069495 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.0, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 1.164179104477597, + "rotationDegrees": -124.509 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 2.0, + "rotation": -124.509 + }, + "reversed": false, + "folder": "[Left] Bump Disrupt", + "idealStartingState": { + "velocity": 4.0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Left Bump Disrupt Entry.path b/src/main/deploy/pathplanner/paths/Left Bump Disrupt Entry.path new file mode 100644 index 0000000..a2f64d5 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Left Bump Disrupt Entry.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.655090117679368, + "y": 7.434229990952901 + }, + "prevControl": null, + "nextControl": { + "x": 4.65509011767937, + "y": 7.434229990952901 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.264507845935014, + "y": 7.276134094155207 + }, + "prevControl": { + "x": 5.289926685119949, + "y": 7.453350886478522 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Left Bump Disrupt] Entry" + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 3.5, + "rotation": 0.0 + }, + "reversed": false, + "folder": "[Left] Bump Disrupt", + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Right Bump Disrupt Block.path b/src/main/deploy/pathplanner/paths/Right Bump Disrupt Block.path new file mode 100644 index 0000000..1695217 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Right Bump Disrupt Block.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.009974856443805, + "y": 0.6719662921348311 + }, + "prevControl": null, + "nextControl": { + "x": 7.02796968517205, + "y": 0.8661313326451534 + }, + "isLocked": false, + "linkedName": "[Right Bump Disrupt] Entry" + }, + { + "anchor": { + "x": 7.840887140551429, + "y": 1.3579805493452808 + }, + "prevControl": { + "x": 7.547923178609416, + "y": 0.8548467886187774 + }, + "nextControl": { + "x": 8.155124140109843, + "y": 1.8976484398912565 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.134630422747337, + "y": 2.9974779383457086 + }, + "prevControl": { + "x": 8.134630422747337, + "y": 1.9974779383457086 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.24647302904564, + "rotationDegrees": 124.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 2.0, + "rotation": 124.0 + }, + "reversed": false, + "folder": "[Right] Bump Disrupt", + "idealStartingState": { + "velocity": 4.0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Right Bump Disrupt Entry.path b/src/main/deploy/pathplanner/paths/Right Bump Disrupt Entry.path new file mode 100644 index 0000000..8020582 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Right Bump Disrupt Entry.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.639534881514021, + "y": 0.6719662921348311 + }, + "prevControl": null, + "nextControl": { + "x": 4.639534881514023, + "y": 0.6719662921348311 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.009974856443805, + "y": 0.6719662921348311 + }, + "prevControl": { + "x": 5.009974856443805, + "y": 0.6719662921348312 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Right Bump Disrupt] Entry" + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 4.5, + "rotation": 0.0 + }, + "reversed": false, + "folder": "[Right] Bump Disrupt", + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] Entry 1.path b/src/main/deploy/pathplanner/paths/[Left Swipe] Entry 1.path new file mode 100644 index 0000000..d8ceeea --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] Entry 1.path @@ -0,0 +1,63 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6127078651673195, + "y": 7.3878426966292965 + }, + "prevControl": null, + "nextControl": { + "x": 4.733719101122375, + "y": 7.530516853932667 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.933696629212264, + "y": 7.03115730337087 + }, + "prevControl": { + "x": 7.34261797752687, + "y": 7.194213483146151 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Left Swipe] Entry 1 to Intake 1" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.30788381742738447, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 0.8157676348547667, + "rotationDegrees": -102.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": -102.265 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 0.0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 1.path b/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 1.path new file mode 100644 index 0000000..ea52a5b --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 1.path @@ -0,0 +1,89 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 7.933696629212264, + "y": 7.03115730337087 + }, + "prevControl": null, + "nextControl": { + "x": 7.933696629212264, + "y": 6.337868868494916 + }, + "isLocked": false, + "linkedName": "[Left Swipe] Entry 1 to Intake 1" + }, + { + "anchor": { + "x": 7.933696629212264, + "y": 5.062089807762963 + }, + "prevControl": { + "x": 7.969051968270556, + "y": 5.309577181178402 + }, + "nextControl": { + "x": 7.892932584269662, + "y": 4.776741493156222 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.985932584269663, + "y": 6.0426292134831465 + }, + "prevControl": { + "x": 6.985932584269663, + "y": 4.554741573033708 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Left Swipe] Intake 1 to StageShoot1" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.5560165975103781, + "rotationDegrees": -102.40100556375558 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.04565756823821024, + "maxWaypointRelativePos": 0.4267990074441744, + "constraints": { + "maxVelocity": 0.75, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 3.0, + "rotation": 90.0 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 0, + "rotation": -102.265 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 2.path b/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 2.path new file mode 100644 index 0000000..c77db16 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] Intake 2.path @@ -0,0 +1,68 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.812685393258427, + "y": 7.061730337078652 + }, + "prevControl": null, + "nextControl": { + "x": 6.802494382022473, + "y": 6.144539325842698 + }, + "isLocked": false, + "linkedName": "[Left Swipe] Reentry 1 to Intake 2" + }, + { + "anchor": { + "x": 5.922158156517307, + "y": 5.567559408383813 + }, + "prevControl": { + "x": 6.5082850713280145, + "y": 5.576717641427731 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Left Swipe] Intake2 to StageShoot2" + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.2, + "constraints": { + "maxVelocity": 1.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 3.0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 3.5, + "rotation": -102.265 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] Reentry 1.path b/src/main/deploy/pathplanner/paths/[Left Swipe] Reentry 1.path new file mode 100644 index 0000000..8575490 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] Reentry 1.path @@ -0,0 +1,63 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.184685393258427, + "y": 7.367460674157303 + }, + "prevControl": null, + "nextControl": { + "x": 3.4323011519061213, + "y": 7.333015992865022 + }, + "isLocked": false, + "linkedName": "[Left Swipe] PostShoot1 to Reentry 1" + }, + { + "anchor": { + "x": 6.812685393258427, + "y": 7.061730337078652 + }, + "prevControl": { + "x": 4.871526943777191, + "y": 7.505709086836602 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Left Swipe] Reentry 1 to Intake 2" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.0240663900414924, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 0.6315352697095409, + "rotationDegrees": 0.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": -102.265 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 0, + "rotation": -66.52706715066263 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot1.path b/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot1.path new file mode 100644 index 0000000..35d4473 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot1.path @@ -0,0 +1,105 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.985932584269663, + "y": 6.0426292134831465 + }, + "prevControl": null, + "nextControl": { + "x": 7.000023991279187, + "y": 7.047947238549122 + }, + "isLocked": false, + "linkedName": "[Left Swipe] Intake 1 to StageShoot1" + }, + { + "anchor": { + "x": 6.539180929244987, + "y": 7.367460674157303 + }, + "prevControl": { + "x": 6.8276652701283815, + "y": 7.316979209602038 + }, + "nextControl": { + "x": 6.292922834860365, + "y": 7.410553027888035 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.2228876404494375, + "y": 7.367460674157303 + }, + "prevControl": { + "x": 6.3729928437130265, + "y": 7.316116691868749 + }, + "nextControl": { + "x": 4.081494382022472, + "y": 7.418415730337078 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.184685393258427, + "y": 7.367460674157303 + }, + "prevControl": { + "x": 3.87767415730337, + "y": 7.347078651685393 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.953526970954383, + "rotationDegrees": 180.0 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.11, + "maxWaypointRelativePos": 1.76, + "constraints": { + "maxVelocity": 2.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 2.0, + "rotation": 90.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot2.path b/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot2.path new file mode 100644 index 0000000..73206ec --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Left Swipe] StageShoot2.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.922158156517307, + "y": 5.567559408383813 + }, + "prevControl": null, + "nextControl": { + "x": 4.560471910112359, + "y": 5.543269662921348 + }, + "isLocked": false, + "linkedName": "[Left Swipe] Intake2 to StageShoot2" + }, + { + "anchor": { + "x": 2.991056179775281, + "y": 5.567559408383813 + }, + "prevControl": { + "x": 4.580853932584269, + "y": 5.553460674157304 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.5, + "maxAcceleration": 4.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 4.5, + "rotation": 180.0 + }, + "reversed": false, + "folder": "[Left] Double Swipe", + "idealStartingState": { + "velocity": 3.0, + "rotation": 180.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] Entry 1.path b/src/main/deploy/pathplanner/paths/[Right Swipe] Entry 1.path new file mode 100644 index 0000000..091927d --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] Entry 1.path @@ -0,0 +1,63 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6127078651673195, + "y": 0.6811573033707043 + }, + "prevControl": null, + "nextControl": { + "x": 4.733719101122375, + "y": 0.5384831460673336 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.933696629212264, + "y": 1.0378426966291308 + }, + "prevControl": { + "x": 7.34261797752687, + "y": 0.8747865168538498 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Right Swipe] Entry 1 to Intake 1" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.30788381742738447, + "rotationDegrees": -0.0 + }, + { + "waypointRelativePos": 0.8157676348547667, + "rotationDegrees": 102.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": 102.265 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 0.0, + "rotation": -0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 1.path b/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 1.path new file mode 100644 index 0000000..34f2507 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 1.path @@ -0,0 +1,89 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 7.933696629212264, + "y": 1.0378426966291308 + }, + "prevControl": null, + "nextControl": { + "x": 7.933696629212264, + "y": 1.7311311315050846 + }, + "isLocked": false, + "linkedName": "[Right Swipe] Entry 1 to Intake 1" + }, + { + "anchor": { + "x": 7.933696629212264, + "y": 2.9975487986925713 + }, + "prevControl": { + "x": 7.969051968270556, + "y": 2.750061425277132 + }, + "nextControl": { + "x": 7.892932584269662, + "y": 3.282897113299312 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.985932584269663, + "y": 2.0263707865168543 + }, + "prevControl": { + "x": 6.840959608233403, + "y": 3.3887350357286063 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Right Swipe] Intake 1 to StageShoot1" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.5560165975103781, + "rotationDegrees": 102.40100556375558 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.04565756823821024, + "maxWaypointRelativePos": 0.3712158808933023, + "constraints": { + "maxVelocity": 1.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 3.0, + "rotation": -90.0 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 0, + "rotation": 102.265 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 2.path b/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 2.path new file mode 100644 index 0000000..fcbfbc9 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] Intake 2.path @@ -0,0 +1,84 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 7.281471910117554, + "y": 1.0694157303404221 + }, + "prevControl": null, + "nextControl": { + "x": 7.3516932933484975, + "y": 2.0031704948881686 + }, + "isLocked": false, + "linkedName": "[Right Swipe] Reentry 1 to Intake 2" + }, + { + "anchor": { + "x": 6.924786516853931, + "y": 3.0260898876404485 + }, + "prevControl": { + "x": 7.639184049069801, + "y": 2.8367736612095276 + }, + "nextControl": { + "x": 6.683127875040819, + "y": 3.090129725530952 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.099314606746768, + "y": 1.8643146067449163 + }, + "prevControl": { + "x": 6.048760951336342, + "y": 3.005068379793869 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Right Swipe] Intake2 to StageShoot2" + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.36327543424318565, + "maxWaypointRelativePos": 0.6531017369727078, + "constraints": { + "maxVelocity": 2.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": -90.0 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 2.0, + "rotation": 102.265 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] Reentry 1.path b/src/main/deploy/pathplanner/paths/[Right Swipe] Reentry 1.path new file mode 100644 index 0000000..efd2a95 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] Reentry 1.path @@ -0,0 +1,63 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.184685393258427, + "y": 0.7015393258426981 + }, + "prevControl": null, + "nextControl": { + "x": 4.184685393258427, + "y": 0.7015393258426981 + }, + "isLocked": false, + "linkedName": "[Right Swipe] PostShoot1 to Reentry 1" + }, + { + "anchor": { + "x": 7.281471910117554, + "y": 1.0694157303404221 + }, + "prevControl": { + "x": 6.496764044950233, + "y": 0.5904382022506188 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "[Right Swipe] Reentry 1 to Intake 2" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.0240663900414924, + "rotationDegrees": -0.0 + }, + { + "waypointRelativePos": 0.4373443983402455, + "rotationDegrees": -0.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": 102.265 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 0, + "rotation": 66.52706715066263 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot1.path b/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot1.path new file mode 100644 index 0000000..ef87df6 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot1.path @@ -0,0 +1,105 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.985932584269663, + "y": 2.0263707865168543 + }, + "prevControl": null, + "nextControl": { + "x": 7.000023991279187, + "y": 1.0210527614508784 + }, + "isLocked": false, + "linkedName": "[Right Swipe] Intake 1 to StageShoot1" + }, + { + "anchor": { + "x": 6.516881888575901, + "y": 0.5990589998344193 + }, + "prevControl": { + "x": 6.805366229459295, + "y": 0.6495404643896843 + }, + "nextControl": { + "x": 6.270623794191279, + "y": 0.555966646103687 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.193517213729849, + "y": 0.5990589998344193 + }, + "prevControl": { + "x": 6.344711612736678, + "y": 0.6104449028086686 + }, + "nextControl": { + "x": 4.943529440613317, + "y": 0.5965864925568396 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.184685393258427, + "y": 0.7015393258426981 + }, + "prevControl": { + "x": 3.87767415730337, + "y": 0.7219213483146074 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.953526970954383, + "rotationDegrees": -180.0 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.2709677419354811, + "maxWaypointRelativePos": 0.7533498759305253, + "constraints": { + "maxVelocity": 2.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -180.0 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 2.0, + "rotation": -90.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot2.path b/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot2.path new file mode 100644 index 0000000..246a498 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/[Right Swipe] StageShoot2.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 6.099314606746768, + "y": 1.8643146067449163 + }, + "prevControl": null, + "nextControl": { + "x": 6.099864155797287, + "y": 1.2693087830908234 + }, + "isLocked": false, + "linkedName": "[Right Swipe] Intake2 to StageShoot2" + }, + { + "anchor": { + "x": 5.894926982172234, + "y": 0.5588599145239721 + }, + "prevControl": { + "x": 6.243320177334823, + "y": 0.5793536318864778 + }, + "nextControl": { + "x": 5.0219236310432755, + "y": 0.5075067762222673 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.92333796460896, + "y": 0.6749909795781683 + }, + "prevControl": { + "x": 3.7264351950132233, + "y": 0.6813754391366251 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.8481327800829823, + "rotationDegrees": 180.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 3.5, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 2.0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "[Right] Double Swipe", + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/settings.json b/src/main/deploy/pathplanner/settings.json index 2c87ad1..52b4bd1 100644 --- a/src/main/deploy/pathplanner/settings.json +++ b/src/main/deploy/pathplanner/settings.json @@ -4,15 +4,30 @@ "holonomicMode": true, "pathFolders": [ "CLB Citrus Auto", + "CRB Citrus Auto", "Default NZ Auto", "Depot Auto", - "CRB Citrus Auto", - "Testing" + "Force Warmup", + "Misc", + "[Right] Bump Disrupt", + "Testing", + "[Left] Bump", + "[Left] Bump Disrupt", + "[Left] Double Swipe", + "[Right] Bump", + "[Right] Double Swipe" ], "autoFolders": [ "Citrus Auto", "Default NZ Auto", - "TestingSpartan" + "Force Warmup", + "[Right] Bump Disrupt", + "TestingSpartan", + "[Left] Bump", + "[Left] Bump Disrupt", + "[Left] Double Swipe", + "[Right] Bump", + "[Right] Double Swipe" ], "defaultMaxVel": 3.0, "defaultMaxAccel": 3.0, diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 79ec7a9..4fd9673 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Code-2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 124; - public static final String GIT_SHA = "084ebbc6a93af8a95535c60ea91df476b60ff34f"; - public static final String GIT_DATE = "2026-03-18 01:21:54 EDT"; - public static final String GIT_BRANCH = "master"; - public static final String BUILD_DATE = "2026-04-08 14:47:16 EDT"; - public static final long BUILD_UNIX_TIME = 1775674036805L; + public static final int GIT_REVISION = 158; + public static final String GIT_SHA = "b6c923628e233616407657cfb9223cd528923c30"; + public static final String GIT_DATE = "2026-04-13 01:23:41 EDT"; + public static final String GIT_BRANCH = "test/2026/FullRobotV3"; + public static final String BUILD_DATE = "2026-04-13 23:35:41 EDT"; + public static final long BUILD_UNIX_TIME = 1776137741238L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/FieldConstants.java b/src/main/java/frc/robot/FieldConstants.java index e6c670e..86f98b8 100644 --- a/src/main/java/frc/robot/FieldConstants.java +++ b/src/main/java/frc/robot/FieldConstants.java @@ -1,367 +1,377 @@ -// Copyright (c) 2025-2026 Littleton Robotics -// http://github.com/Mechanical-Advantage -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file at -// the root directory of this project. - -package frc.robot; - -import com.fasterxml.jackson.databind.ObjectMapper; -import edu.wpi.first.apriltag.AprilTagFieldLayout; -import edu.wpi.first.math.geometry.Pose2d; -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.math.geometry.Translation3d; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.wpilibj.Filesystem; -import java.io.IOException; -import java.nio.file.Path; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Contains information for location of field element and other useful reference points. - * - *
NOTE: All constants are defined relative to the field coordinate system, and from the - * perspective of the blue alliance station - */ -public class FieldConstants { - public static final FieldType fieldType = FieldType.WELDED; - - // AprilTag related constants - public static final int aprilTagCount = AprilTagLayoutType.OFFICIAL.getLayout().getTags().size(); - public static final double aprilTagWidth = Units.inchesToMeters(6.5); - public static final AprilTagLayoutType defaultAprilTagType = AprilTagLayoutType.OFFICIAL; - - // Field dimensions - public static final double fieldLength = AprilTagLayoutType.OFFICIAL.getLayout().getFieldLength(); - public static final double fieldWidth = AprilTagLayoutType.OFFICIAL.getLayout().getFieldWidth(); - - /** - * Officially defined and relevant vertical lines found on the field (defined by X-axis offset) - */ - public static class LinesVertical { - public static final double center = fieldLength / 2.0; - public static final double starting = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX(); - public static final double allianceZone = starting; - public static final double hubCenter = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + Hub.width / 2.0; - public static final double neutralZoneNear = center - Units.inchesToMeters(120); - public static final double neutralZoneFar = center + Units.inchesToMeters(120); - public static final double oppHubCenter = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(4).get().getX() + Hub.width / 2.0; - public static final double oppAllianceZone = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(10).get().getX(); - } - - /** - * Officially defined and relevant horizontal lines found on the field (defined by Y-axis offset) - * - *
NOTE: The field element start and end are always left to right from the perspective of the - * alliance station - */ - public static class LinesHorizontal { - - public static final double center = fieldWidth / 2.0; - - // Right of hub - public static final double rightBumpStart = Hub.nearRightCorner.getY(); - public static final double rightBumpEnd = rightBumpStart - RightBump.width; - public static final double rightTrenchOpenStart = rightBumpEnd - Units.inchesToMeters(12.0); - public static final double rightTrenchOpenEnd = 0; - - // Left of hub - public static final double leftBumpEnd = Hub.nearLeftCorner.getY(); - public static final double leftBumpStart = leftBumpEnd + LeftBump.width; - public static final double leftTrenchOpenEnd = leftBumpStart + Units.inchesToMeters(12.0); - public static final double leftTrenchOpenStart = fieldWidth; - } - - /** Hub related constants */ - public static class Hub { - - // Dimensions - public static final double width = Units.inchesToMeters(47.0); - public static final double height = - Units.inchesToMeters(72.0); // includes the catcher at the top - public static final double innerWidth = Units.inchesToMeters(41.7); - public static final double innerHeight = Units.inchesToMeters(56.5); - - // Relevant reference points on alliance side - public static final Translation3d topCenterPoint = - new Translation3d( - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + width / 2.0, - fieldWidth / 2.0, - height); - public static final Translation3d innerCenterPoint = - new Translation3d( - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + width / 2.0, - fieldWidth / 2.0, - innerHeight); - - public static final Translation2d nearLeftCorner = - new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / 2.0); - public static final Translation2d nearRightCorner = - new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / 2.0); - public static final Translation2d farLeftCorner = - new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / 2.0); - public static final Translation2d farRightCorner = - new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / 2.0); - - // Relevant reference points on the opposite side - public static final Translation3d oppTopCenterPoint = - new Translation3d( - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(4).get().getX() + width / 2.0, - fieldWidth / 2.0, - height); - public static final Translation2d oppNearLeftCorner = - new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / 2.0); - public static final Translation2d oppNearRightCorner = - new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / 2.0); - public static final Translation2d oppFarLeftCorner = - new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / 2.0); - public static final Translation2d oppFarRightCorner = - new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / 2.0); - - // Hub faces - public static final Pose2d nearFace = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().toPose2d(); - public static final Pose2d farFace = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(20).get().toPose2d(); - public static final Pose2d rightFace = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(18).get().toPose2d(); - public static final Pose2d leftFace = - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(21).get().toPose2d(); - } - - /** Left Bump related constants */ - public static class LeftBump { - - // Dimensions - public static final double width = Units.inchesToMeters(73.0); - public static final double height = Units.inchesToMeters(6.513); - public static final double depth = Units.inchesToMeters(44.4); - - // Relevant reference points on alliance side - public static final Translation2d nearLeftCorner = - new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); - public static final Translation2d nearRightCorner = Hub.nearLeftCorner; - public static final Translation2d farLeftCorner = - new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); - public static final Translation2d farRightCorner = Hub.farLeftCorner; - - // Relevant reference points on opposing side - public static final Translation2d oppNearLeftCorner = - new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); - public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; - public static final Translation2d oppFarLeftCorner = - new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); - public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; - } - - /** Right Bump related constants */ - public static class RightBump { - // Dimensions - public static final double width = Units.inchesToMeters(73.0); - public static final double height = Units.inchesToMeters(6.513); - public static final double depth = Units.inchesToMeters(44.4); - - // Relevant reference points on alliance side - public static final Translation2d nearLeftCorner = - new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); - public static final Translation2d nearRightCorner = Hub.nearLeftCorner; - public static final Translation2d farLeftCorner = - new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); - public static final Translation2d farRightCorner = Hub.farLeftCorner; - - // Relevant reference points on opposing side - public static final Translation2d oppNearLeftCorner = - new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); - public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; - public static final Translation2d oppFarLeftCorner = - new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); - public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; - } - - /** Left Trench related constants */ - public static class LeftTrench { - // Dimensions - public static final double width = Units.inchesToMeters(65.65); - public static final double depth = Units.inchesToMeters(47.0); - public static final double height = Units.inchesToMeters(40.25); - public static final double openingWidth = Units.inchesToMeters(50.34); - public static final double openingHeight = Units.inchesToMeters(22.25); - - // Relevant reference points on alliance side - public static final Translation3d openingTopLeft = - new Translation3d(LinesVertical.hubCenter, fieldWidth, openingHeight); - public static final Translation3d openingTopRight = - new Translation3d(LinesVertical.hubCenter, fieldWidth - openingWidth, openingHeight); - - // Relevant reference points on opposing side - public static final Translation3d oppOpeningTopLeft = - new Translation3d(LinesVertical.oppHubCenter, fieldWidth, openingHeight); - public static final Translation3d oppOpeningTopRight = - new Translation3d(LinesVertical.oppHubCenter, fieldWidth - openingWidth, openingHeight); - } - - public static class RightTrench { - - // Dimensions - public static final double width = Units.inchesToMeters(65.65); - public static final double depth = Units.inchesToMeters(47.0); - public static final double height = Units.inchesToMeters(40.25); - public static final double openingWidth = Units.inchesToMeters(50.34); - public static final double openingHeight = Units.inchesToMeters(22.25); - - // Relevant reference points on alliance side - public static final Translation3d openingTopLeft = - new Translation3d(LinesVertical.hubCenter, openingWidth, openingHeight); - public static final Translation3d openingTopRight = - new Translation3d(LinesVertical.hubCenter, 0, openingHeight); - - // Relevant reference points on opposing side - public static final Translation3d oppOpeningTopLeft = - new Translation3d(LinesVertical.oppHubCenter, openingWidth, openingHeight); - public static final Translation3d oppOpeningTopRight = - new Translation3d(LinesVertical.oppHubCenter, 0, openingHeight); - } - - /** Tower related constants */ - public static class Tower { - // Dimensions - public static final double width = Units.inchesToMeters(49.25); - public static final double depth = Units.inchesToMeters(45.0); - public static final double height = Units.inchesToMeters(78.25); - public static final double innerOpeningWidth = Units.inchesToMeters(32.250); - public static final double frontFaceX = Units.inchesToMeters(43.51); - - public static final double uprightHeight = Units.inchesToMeters(72.1); - - // Rung heights from the floor - public static final double lowRungHeight = Units.inchesToMeters(27.0); - public static final double midRungHeight = Units.inchesToMeters(45.0); - public static final double highRungHeight = Units.inchesToMeters(63.0); - - // Relevant reference points on alliance side - public static final Translation2d centerPoint = - new Translation2d( - frontFaceX, AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()); - public static final Translation2d leftUpright = - new Translation2d( - frontFaceX, - (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()) - + innerOpeningWidth / 2 - + Units.inchesToMeters(0.75)); - public static final Translation2d rightUpright = - new Translation2d( - frontFaceX, - (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()) - - innerOpeningWidth / 2 - - Units.inchesToMeters(0.75)); - - // Relevant reference points on opposing side - public static final Translation2d oppCenterPoint = - new Translation2d( - fieldLength - frontFaceX, - AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()); - public static final Translation2d oppLeftUpright = - new Translation2d( - fieldLength - frontFaceX, - (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()) - + innerOpeningWidth / 2 - + Units.inchesToMeters(0.75)); - public static final Translation2d oppRightUpright = - new Translation2d( - fieldLength - frontFaceX, - (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()) - - innerOpeningWidth / 2 - - Units.inchesToMeters(0.75)); - } - - public static class Depot { - // Dimensions - public static final double width = Units.inchesToMeters(42.0); - public static final double depth = Units.inchesToMeters(27.0); - public static final double height = Units.inchesToMeters(1.125); - public static final double distanceFromCenterY = Units.inchesToMeters(75.93); - - // Relevant reference points on alliance side - public static final Translation3d depotCenter = - new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY, height); - public static final Translation3d leftCorner = - new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY + (width / 2), height); - public static final Translation3d rightCorner = - new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY - (width / 2), height); - } - - public static class Outpost { - // Dimensions - public static final double width = Units.inchesToMeters(31.8); - public static final double openingDistanceFromFloor = Units.inchesToMeters(28.1); - public static final double height = Units.inchesToMeters(7.0); - - // Relevant reference points on alliance side - public static final Translation2d centerPoint = - new Translation2d(0, AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(29).get().getY()); - } - - @RequiredArgsConstructor - public enum FieldType { - ANDYMARK("andymark"), - WELDED("welded"); - - @Getter private final String jsonFolder; - } - - public enum AprilTagLayoutType { - OFFICIAL("2026-official"), - NONE("2026-none"); - - private final String name; - private volatile AprilTagFieldLayout layout; - private volatile String layoutString; - - AprilTagLayoutType(String name) { - this.name = name; - } - - public AprilTagFieldLayout getLayout() { - if (layout == null) { - synchronized (this) { - if (layout == null) { - try { - Path p = - Constants.disableHAL - ? Path.of( - "src", - "main", - "deploy", - "apriltags", - fieldType.getJsonFolder(), - name + ".json") - : Path.of( - Filesystem.getDeployDirectory().getPath(), - "apriltags", - fieldType.getJsonFolder(), - name + ".json"); - layout = new AprilTagFieldLayout(p); - layoutString = new ObjectMapper().writeValueAsString(layout); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - } - return layout; - } - - public String getLayoutString() { - if (layoutString == null) { - getLayout(); - } - return layoutString; - } - } -} +// // Copyright (c) 2025-2026 Littleton Robotics +// // http://github.com/Mechanical-Advantage +// // +// // Use of this source code is governed by an MIT-style +// // license that can be found in the LICENSE file at +// // the root directory of this project. + +// package frc.robot; + +// import com.fasterxml.jackson.databind.ObjectMapper; +// import edu.wpi.first.apriltag.AprilTagFieldLayout; +// import edu.wpi.first.math.geometry.Pose2d; +// import edu.wpi.first.math.geometry.Translation2d; +// import edu.wpi.first.math.geometry.Translation3d; +// import edu.wpi.first.math.util.Units; +// import edu.wpi.first.wpilibj.Filesystem; +// import java.io.IOException; +// import java.nio.file.Path; +// import lombok.Getter; +// import lombok.RequiredArgsConstructor; + +// /** +// * Contains information for location of field element and other useful reference points. +// * +// *
NOTE: All constants are defined relative to the field coordinate system, and from the +// * perspective of the blue alliance station +// */ +// public class FieldConstants { +// public static final FieldType fieldType = FieldType.WELDED; + +// // AprilTag related constants +// public static final int aprilTagCount = +// AprilTagLayoutType.OFFICIAL.getLayout().getTags().size(); +// public static final double aprilTagWidth = Units.inchesToMeters(6.5); +// public static final AprilTagLayoutType defaultAprilTagType = AprilTagLayoutType.OFFICIAL; + +// // Field dimensions +// public static final double fieldLength = +// AprilTagLayoutType.OFFICIAL.getLayout().getFieldLength(); +// public static final double fieldWidth = +// AprilTagLayoutType.OFFICIAL.getLayout().getFieldWidth(); + +// /** +// * Officially defined and relevant vertical lines found on the field (defined by X-axis offset) +// */ +// public static class LinesVertical { +// public static final double center = fieldLength / 2.0; +// public static final double starting = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX(); +// public static final double allianceZone = starting; +// public static final double hubCenter = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + Hub.width / 2.0; +// public static final double neutralZoneNear = center - Units.inchesToMeters(120); +// public static final double neutralZoneFar = center + Units.inchesToMeters(120); +// public static final double oppHubCenter = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(4).get().getX() + Hub.width / 2.0; +// public static final double oppAllianceZone = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(10).get().getX(); +// } + +// /** +// * Officially defined and relevant horizontal lines found on the field (defined by Y-axis +// offset) +// * +// *
NOTE: The field element start and end are always left to right from the perspective of +// the +// * alliance station +// */ +// public static class LinesHorizontal { + +// public static final double center = fieldWidth / 2.0; + +// // Right of hub +// public static final double rightBumpStart = Hub.nearRightCorner.getY(); +// public static final double rightBumpEnd = rightBumpStart - RightBump.width; +// public static final double rightTrenchOpenStart = rightBumpEnd - Units.inchesToMeters(12.0); +// public static final double rightTrenchOpenEnd = 0; + +// // Left of hub +// public static final double leftBumpEnd = Hub.nearLeftCorner.getY(); +// public static final double leftBumpStart = leftBumpEnd + LeftBump.width; +// public static final double leftTrenchOpenEnd = leftBumpStart + Units.inchesToMeters(12.0); +// public static final double leftTrenchOpenStart = fieldWidth; +// } + +// /** Hub related constants */ +// public static class Hub { + +// // Dimensions +// public static final double width = Units.inchesToMeters(47.0); +// public static final double height = +// Units.inchesToMeters(72.0); // includes the catcher at the top +// public static final double innerWidth = Units.inchesToMeters(41.7); +// public static final double innerHeight = Units.inchesToMeters(56.5); + +// // Relevant reference points on alliance side +// public static final Translation3d topCenterPoint = +// new Translation3d( +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + width / 2.0, +// fieldWidth / 2.0, +// height); +// public static final Translation3d innerCenterPoint = +// new Translation3d( +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().getX() + width / 2.0, +// fieldWidth / 2.0, +// innerHeight); + +// public static final Translation2d nearLeftCorner = +// new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / 2.0); +// public static final Translation2d nearRightCorner = +// new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / 2.0); +// public static final Translation2d farLeftCorner = +// new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / 2.0); +// public static final Translation2d farRightCorner = +// new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / 2.0); + +// // Relevant reference points on the opposite side +// public static final Translation3d oppTopCenterPoint = +// new Translation3d( +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(4).get().getX() + width / 2.0, +// fieldWidth / 2.0, +// height); +// public static final Translation2d oppNearLeftCorner = +// new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / +// 2.0); +// public static final Translation2d oppNearRightCorner = +// new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / +// 2.0); +// public static final Translation2d oppFarLeftCorner = +// new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / +// 2.0); +// public static final Translation2d oppFarRightCorner = +// new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / +// 2.0); + +// // Hub faces +// public static final Pose2d nearFace = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(26).get().toPose2d(); +// public static final Pose2d farFace = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(20).get().toPose2d(); +// public static final Pose2d rightFace = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(18).get().toPose2d(); +// public static final Pose2d leftFace = +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(21).get().toPose2d(); +// } + +// /** Left Bump related constants */ +// public static class LeftBump { + +// // Dimensions +// public static final double width = Units.inchesToMeters(73.0); +// public static final double height = Units.inchesToMeters(6.513); +// public static final double depth = Units.inchesToMeters(44.4); + +// // Relevant reference points on alliance side +// public static final Translation2d nearLeftCorner = +// new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); +// public static final Translation2d nearRightCorner = Hub.nearLeftCorner; +// public static final Translation2d farLeftCorner = +// new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); +// public static final Translation2d farRightCorner = Hub.farLeftCorner; + +// // Relevant reference points on opposing side +// public static final Translation2d oppNearLeftCorner = +// new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); +// public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; +// public static final Translation2d oppFarLeftCorner = +// new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); +// public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; +// } + +// /** Right Bump related constants */ +// public static class RightBump { +// // Dimensions +// public static final double width = Units.inchesToMeters(73.0); +// public static final double height = Units.inchesToMeters(6.513); +// public static final double depth = Units.inchesToMeters(44.4); + +// // Relevant reference points on alliance side +// public static final Translation2d nearLeftCorner = +// new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); +// public static final Translation2d nearRightCorner = Hub.nearLeftCorner; +// public static final Translation2d farLeftCorner = +// new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); +// public static final Translation2d farRightCorner = Hub.farLeftCorner; + +// // Relevant reference points on opposing side +// public static final Translation2d oppNearLeftCorner = +// new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); +// public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; +// public static final Translation2d oppFarLeftCorner = +// new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); +// public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; +// } + +// /** Left Trench related constants */ +// public static class LeftTrench { +// // Dimensions +// public static final double width = Units.inchesToMeters(65.65); +// public static final double depth = Units.inchesToMeters(47.0); +// public static final double height = Units.inchesToMeters(40.25); +// public static final double openingWidth = Units.inchesToMeters(50.34); +// public static final double openingHeight = Units.inchesToMeters(22.25); + +// // Relevant reference points on alliance side +// public static final Translation3d openingTopLeft = +// new Translation3d(LinesVertical.hubCenter, fieldWidth, openingHeight); +// public static final Translation3d openingTopRight = +// new Translation3d(LinesVertical.hubCenter, fieldWidth - openingWidth, openingHeight); + +// // Relevant reference points on opposing side +// public static final Translation3d oppOpeningTopLeft = +// new Translation3d(LinesVertical.oppHubCenter, fieldWidth, openingHeight); +// public static final Translation3d oppOpeningTopRight = +// new Translation3d(LinesVertical.oppHubCenter, fieldWidth - openingWidth, openingHeight); +// } + +// public static class RightTrench { + +// // Dimensions +// public static final double width = Units.inchesToMeters(65.65); +// public static final double depth = Units.inchesToMeters(47.0); +// public static final double height = Units.inchesToMeters(40.25); +// public static final double openingWidth = Units.inchesToMeters(50.34); +// public static final double openingHeight = Units.inchesToMeters(22.25); + +// // Relevant reference points on alliance side +// public static final Translation3d openingTopLeft = +// new Translation3d(LinesVertical.hubCenter, openingWidth, openingHeight); +// public static final Translation3d openingTopRight = +// new Translation3d(LinesVertical.hubCenter, 0, openingHeight); + +// // Relevant reference points on opposing side +// public static final Translation3d oppOpeningTopLeft = +// new Translation3d(LinesVertical.oppHubCenter, openingWidth, openingHeight); +// public static final Translation3d oppOpeningTopRight = +// new Translation3d(LinesVertical.oppHubCenter, 0, openingHeight); +// } + +// /** Tower related constants */ +// public static class Tower { +// // Dimensions +// public static final double width = Units.inchesToMeters(49.25); +// public static final double depth = Units.inchesToMeters(45.0); +// public static final double height = Units.inchesToMeters(78.25); +// public static final double innerOpeningWidth = Units.inchesToMeters(32.250); +// public static final double frontFaceX = Units.inchesToMeters(43.51); + +// public static final double uprightHeight = Units.inchesToMeters(72.1); + +// // Rung heights from the floor +// public static final double lowRungHeight = Units.inchesToMeters(27.0); +// public static final double midRungHeight = Units.inchesToMeters(45.0); +// public static final double highRungHeight = Units.inchesToMeters(63.0); + +// // Relevant reference points on alliance side +// public static final Translation2d centerPoint = +// new Translation2d( +// frontFaceX, AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()); +// public static final Translation2d leftUpright = +// new Translation2d( +// frontFaceX, +// (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()) +// + innerOpeningWidth / 2 +// + Units.inchesToMeters(0.75)); +// public static final Translation2d rightUpright = +// new Translation2d( +// frontFaceX, +// (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(31).get().getY()) +// - innerOpeningWidth / 2 +// - Units.inchesToMeters(0.75)); + +// // Relevant reference points on opposing side +// public static final Translation2d oppCenterPoint = +// new Translation2d( +// fieldLength - frontFaceX, +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()); +// public static final Translation2d oppLeftUpright = +// new Translation2d( +// fieldLength - frontFaceX, +// (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()) +// + innerOpeningWidth / 2 +// + Units.inchesToMeters(0.75)); +// public static final Translation2d oppRightUpright = +// new Translation2d( +// fieldLength - frontFaceX, +// (AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(15).get().getY()) +// - innerOpeningWidth / 2 +// - Units.inchesToMeters(0.75)); +// } + +// public static class Depot { +// // Dimensions +// public static final double width = Units.inchesToMeters(42.0); +// public static final double depth = Units.inchesToMeters(27.0); +// public static final double height = Units.inchesToMeters(1.125); +// public static final double distanceFromCenterY = Units.inchesToMeters(75.93); + +// // Relevant reference points on alliance side +// public static final Translation3d depotCenter = +// new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY, height); +// public static final Translation3d leftCorner = +// new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY + (width / 2), height); +// public static final Translation3d rightCorner = +// new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY - (width / 2), height); +// } + +// public static class Outpost { +// // Dimensions +// public static final double width = Units.inchesToMeters(31.8); +// public static final double openingDistanceFromFloor = Units.inchesToMeters(28.1); +// public static final double height = Units.inchesToMeters(7.0); + +// // Relevant reference points on alliance side +// public static final Translation2d centerPoint = +// new Translation2d(0, +// AprilTagLayoutType.OFFICIAL.getLayout().getTagPose(29).get().getY()); +// } + +// @RequiredArgsConstructor +// public enum FieldType { +// ANDYMARK("andymark"), +// WELDED("welded"); + +// @Getter private final String jsonFolder; +// } + +// public enum AprilTagLayoutType { +// OFFICIAL("2026-official"), +// NONE("2026-none"); + +// private final String name; +// private volatile AprilTagFieldLayout layout; +// private volatile String layoutString; + +// AprilTagLayoutType(String name) { +// this.name = name; +// } + +// public AprilTagFieldLayout getLayout() { +// if (layout == null) { +// synchronized (this) { +// if (layout == null) { +// try { +// Path p = +// Constants.disableHAL +// ? Path.of( +// "src", +// "main", +// "deploy", +// "apriltags", +// fieldType.getJsonFolder(), +// name + ".json") +// : Path.of( +// Filesystem.getDeployDirectory().getPath(), +// "apriltags", +// fieldType.getJsonFolder(), +// name + ".json"); +// layout = new AprilTagFieldLayout(p); +// layoutString = new ObjectMapper().writeValueAsString(layout); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } +// } +// } +// } +// return layout; +// } + +// public String getLayoutString() { +// if (layoutString == null) { +// getLayout(); +// } +// return layoutString; +// } +// } +// } diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index cc038e5..e2f05f5 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -13,10 +13,14 @@ package frc.robot; +import com.pathplanner.lib.commands.PathPlannerAuto; import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; +import edu.wpi.first.wpilibj2.command.WaitCommand; import frc.robot.Constants.Mode; import frc.robot.subsystems.vision.VisionConstants; import frc.robot.util.FullSubsystem; @@ -42,6 +46,9 @@ public class Robot extends LoggedRobot { private RobotContainer robotContainer; private Timer m_gcTimer = new Timer(); + private Timer m_matchTimer = new Timer(); + private Timer m_shiftTimer = new Timer(); + private boolean shiftBoolean = false; // Flag to ensure we only apply the alliance offset once per DS connection @AutoLogOutput(key = "Robot/HasInitializedAlliancePose") @@ -148,6 +155,12 @@ public void disabledInit() { } else { hasInitializedAlliancePose = false; } + + // Handle PathPlanner States Initialization by Running an Auto Routine + // Should not actually drive, only warmups up the PathPlanner library + // See: https://www.chiefdelphi.com/t/pathplanner-initial-lag-after-deploying-code/455068/7 + Command forcedAutoInitCommand = new PathPlannerAuto("Force Warmup").ignoringDisable(true); + CommandScheduler.getInstance().schedule(forcedAutoInitCommand); } /** This function is called periodically when disabled. */ @@ -170,9 +183,13 @@ public void autonomousInit() { autonomousCommand = robotContainer.getAutonomousCommand(); + // schedule the autonomous command (example) + // 3847: Time Delay to prevent Auto from firing with a delay + Command delaggerWaitCommand = new WaitCommand(0.01); + // schedule the autonomous command (example) if (autonomousCommand != null) { - CommandScheduler.getInstance().schedule(autonomousCommand); + CommandScheduler.getInstance().schedule(delaggerWaitCommand.andThen(autonomousCommand)); } } @@ -189,17 +206,54 @@ public void teleopInit() { // this line or comment it out. if (autonomousCommand != null) { autonomousCommand.cancel(); + autonomousCommand = null; } // Handle edge case where alliance data isn't recieved before enabled if (!hasInitializedAlliancePose) { robotContainer.applyAlliancePoseOffset(); } + m_matchTimer.reset(); + m_shiftTimer.stop(); + m_shiftTimer.reset(); + m_matchTimer.start(); } /** This function is called periodically during operator control. */ @Override - public void teleopPeriodic() {} + public void teleopPeriodic() { + + if (!DriverStation.getGameSpecificMessage().isEmpty()) { + SmartDashboard.putBoolean("Game MSG Recieved", true); + if (!m_shiftTimer.isRunning()) { + shiftBoolean = + !(((DriverStation.getGameSpecificMessage().charAt(0) == 'B') + && (DriverStation.getAlliance().get() == Alliance.Blue)) + || ((DriverStation.getGameSpecificMessage().charAt(0) == 'R') + && (DriverStation.getAlliance().get() == Alliance.Red))); + } + } else { + SmartDashboard.putBoolean("Game MSG Recieved", false); + } + if (m_matchTimer.hasElapsed(10)) { + if (!m_shiftTimer.isRunning() && !m_matchTimer.hasElapsed(110)) { + m_shiftTimer.start(); + } else if (m_shiftTimer.advanceIfElapsed(25)) { + shiftBoolean = !shiftBoolean; + } else if (m_matchTimer.hasElapsed(110)) { + m_shiftTimer.stop(); + SmartDashboard.putBoolean("EndGame", true); + shiftBoolean = true; + } else SmartDashboard.putBoolean("EndGame", false); + + } else { + shiftBoolean = true; + } + + SmartDashboard.putBoolean("SHOOT", shiftBoolean); + SmartDashboard.putNumber("Match Timer", 140 - m_matchTimer.get()); + SmartDashboard.putNumber("Shift Timer", 25 - m_shiftTimer.get()); + } /** This function is called once when test mode is enabled. */ @Override diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 5daf686..db1b8ea 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -26,6 +26,7 @@ import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; +import frc.robot.commands.CrossBumpCommand; import frc.robot.commands.DriveCommands; import frc.robot.subsystems.agitator.AgitatorIO; import frc.robot.subsystems.agitator.AgitatorIOSim; @@ -125,10 +126,14 @@ public RobotContainer() { swerveSubsystem::addVisionMeasurement, swerveSubsystem::getRotation, swerveSubsystem::getChassisSpeeds, - new VisionIOLimelight(VisionConstants.cameraYellow, swerveSubsystem::getRotation), - new VisionIOLimelight(VisionConstants.cameraPurple, swerveSubsystem::getRotation)); - // new VisionIOLimelight(VisionConstants.cameraPink, swerveSubsystem::getRotation)); - // new VisionIOLimelight(VisionConstants.cameraOrange, swerveSubsystem::getRotation)); + new VisionIOLimelight( + VisionConstants.cameraYellow, + swerveSubsystem::getRotation, + swerveSubsystem::getYawVelocityRate), + new VisionIOLimelight( + VisionConstants.cameraPink, + swerveSubsystem::getRotation, + swerveSubsystem::getYawVelocityRate)); shotCalculator = new ShotCalculator(swerveSubsystem); @@ -233,7 +238,7 @@ public RobotContainer() { // ------- Indexer Auto NamedCommands -------- \\ - NamedCommands.registerCommand("indexerIndex", indexerSubsystem.runCurrentCommand()); + NamedCommands.registerCommand("indexerIndex", indexerSubsystem.indexCommand()); // ------- Kicker Auto NamedCommands -------- \\ @@ -266,6 +271,14 @@ public RobotContainer() { () -> -driver.getLeftX(), () -> shotCalculator.getCorrectTargetRotation())); + NamedCommands.registerCommand( + "crossBumpNeutralZone", + new CrossBumpCommand(swerveSubsystem, CrossBumpCommand.CrossDirection.TO_NEUTRAL)); + + NamedCommands.registerCommand( + "crossBumpAllianceZone", + new CrossBumpCommand(swerveSubsystem, CrossBumpCommand.CrossDirection.TO_ALLIANCE)); + // Set up auto routines autoChooser = new LoggedDashboardChooser<>("Auto Choices", AutoBuilder.buildAutoChooser()); @@ -319,10 +332,11 @@ private void configureButtonBindings() { driver .leftBumper() - .whileTrue(indexerSubsystem.runCurrentCommand()) + .whileTrue(indexerSubsystem.indexCommand()) .whileTrue(kickerSubsystem.indexCommand()) .whileTrue(agitatorSubsystem.indexCommand()) - .whileTrue(pivotSubsystem.runSaltAndPepperCommand()); + .whileTrue(pivotSubsystem.runSaltAndPepperCommand()) + .whileTrue(rollerSubsystem.intakeCommand()); driver .rightBumper() @@ -331,7 +345,11 @@ private void configureButtonBindings() { swerveSubsystem, () -> -driver.getLeftY(), () -> -driver.getLeftX(), - () -> shotCalculator.getCorrectTargetRotation())); + () -> shotCalculator.getCorrectTargetRotation())) + .whileTrue( + hoodSubsystem.dynamicUpdatedShootCommandWithLinearCompensation( + () -> Units.degreesToRadians(shotCalculator.getCorrectedTargetAngle()))) + .whileFalse(hoodSubsystem.trenchHoodCommand()); driver .b() @@ -351,8 +369,19 @@ private void configureButtonBindings() { swerveSubsystem) .ignoringDisable(true)); - driver.povUp().onTrue(hoodSubsystem.runDebuggingUpCommand()); - driver.povDown().onTrue(hoodSubsystem.runDebuggingDownCommand()); + driver.povUp().onTrue(Commands.runOnce(() -> hoodSubsystem.shotCompensation--, hoodSubsystem)); + driver + .povDown() + .onTrue(Commands.runOnce(() -> hoodSubsystem.shotCompensation++, hoodSubsystem)); + + driver + .povLeft() + .onTrue(Commands.runOnce(() -> hoodSubsystem.shotCompensation = 0, hoodSubsystem)); + + driver.povRight().whileTrue(flywheelSubsystem.runDebuggingVelocityCommand()); + + driver.leftTrigger().whileTrue(hoodSubsystem.runDebuggingVoltageUpCommand()); + driver.rightTrigger().whileTrue(hoodSubsystem.runDebuggingVoltageDownCommand()); // ------- Operator Controls -------- \\ @@ -367,14 +396,12 @@ private void configureButtonBindings() { operator.b().whileTrue(rollerSubsystem.runUnjamCommand()); operator - .y() - .whileTrue( - hoodSubsystem.dynamicUpdatedShootCommand( - () -> Units.degreesToRadians(shotCalculator.getCorrectedTargetAngle()))) + .rightTrigger() .whileTrue( flywheelSubsystem.dynamicUpdatedShootCommand( () -> shotCalculator.getCorrectTargetVelocity())); + // Disabled toggleWarm on Operator because of fat-keying during intaking operator.a().onTrue(flywheelSubsystem.toggleWarm()); // Shifted from DPad Left operator @@ -426,6 +453,17 @@ public Command getAutonomousCommand() { return autoChooser.get(); } + /** + * See: https://www.chiefdelphi.com/t/fatal-robot-code-crash/427074/26 + * + *
Use this to clear the autonomous command connected to main {@link Robot} class.
+ *
+ * @return
+ */
+ // public void killAutonomousBuilder(){
+ // autoChooser.
+ // }
+
// Only use for Driver Reset Button Binding
public Rotation2d returnGlobalSwerveOffset() {
if (!DriverStation.getAlliance().isPresent()) {
diff --git a/src/main/java/frc/robot/commands/CrossBumpCommand.java b/src/main/java/frc/robot/commands/CrossBumpCommand.java
new file mode 100644
index 0000000..6c0c879
--- /dev/null
+++ b/src/main/java/frc/robot/commands/CrossBumpCommand.java
@@ -0,0 +1,344 @@
+package frc.robot.commands;
+
+import edu.wpi.first.math.filter.Debouncer;
+import edu.wpi.first.math.filter.Debouncer.DebounceType;
+import edu.wpi.first.math.kinematics.ChassisSpeeds;
+import edu.wpi.first.math.util.Units;
+import edu.wpi.first.wpilibj.DriverStation;
+import edu.wpi.first.wpilibj.DriverStation.Alliance;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj2.command.Command;
+import frc.robot.subsystems.swerve.SwerveSubsystem;
+import java.util.Optional;
+import org.littletonrobotics.junction.AutoLogOutput;
+import org.littletonrobotics.junction.Logger;
+
+public class CrossBumpCommand extends Command {
+
+ // ----------------------------------Direction Enum------------------------------//
+ public enum CrossDirection {
+ // from alliance zone toward the neutral zone.
+ TO_NEUTRAL,
+
+ // from neutral zone toward the alliance zone.
+ TO_ALLIANCE
+ }
+
+ // ----------------------------------Internal State Machine------------------------------//
+
+ private enum BumpState {
+
+ // Driving at approach speed before any pitch is detected.
+ // Exits when pitch exceeds PITCH_ENTRY_THRESHOLD_RAD.
+ APPROACHING,
+
+ // Exits when pitch velocity crosses zero (peak detected)
+ CLIMBING,
+
+ // Exits when pitch drops below -PITCH_ENTRY_THRESHOLD_RAD (descent confirmed)
+ // or if peak pitch was small (robot straddled >:| the upward ramp).
+ CRESTING,
+
+ // Continue at BUMP_SPEED_MS.
+ // Exits when pitch rises above -PITCH_FLAT_THRESHOLD_RAD for SETTLE_DEBOUNCE_SECONDS (all
+ // wheels back on flat ground).
+ DESCENDING,
+
+ // Command ends after SETTLE_DEBOUNCE_SECONDS of flat pitch.
+ LEVELING,
+
+ // isFinished() returns true.
+ COMPLETE,
+
+ /**
+ * Safety state: bump was not detected within APPROACH_TIMEOUT_SECONDS. Robot may have stopped,
+ * missed the bump, or negligently our pitch sign is inverted. isFinished() returns true to
+ * prevent blocking the Command scheduler since we have a addRequirements call.
+ */
+ TIMED_OUT
+ }
+
+ // ----------------------------------Internal Constants ------------------------------//
+
+ public static final class BumpConstants {
+
+ // Start at 1.0 m/s/low value and tune up if the robot stalls on the ramp edge.
+ public static double APPROACH_SPEED_MS = 4.0;
+
+ public static double BUMP_SPEED_MS = 5.0;
+
+ // Speed during the LEVELING phase (all wheels back on flat ground) in m/s.
+ public static double SETTLE_SPEED_MS = 0.4;
+
+ /**
+ * Pitch threshold in radians to detect ramp entry (APPROACHING to CLIMBING). 3 degrees = 0.052
+ * rad. Too low: false positives. Too high: robot is already significantly on the ramp before
+ * detecting it.
+ */
+ public static double PITCH_ENTRY_THRESHOLD_RAD = Units.degreesToRadians(3.0);
+
+ /**
+ * Minimum peak pitch to confirm a real bump. 5 degrees = 0.087 rad. Prevents false cresting
+ * detection on flat ground. The bump's actual peak is 8.35 deg (AI found) This threshold should
+ * be below 8.35 deg to catch cases if the robot crosses near the ramp edge.
+ */
+ public static double PITCH_PEAK_MIN_RAD = Units.degreesToRadians(5.0);
+
+ /** Use something small like 1.5 degrees */
+ public static double PITCH_FLAT_THRESHOLD_RAD = Units.degreesToRadians(1.5);
+
+ // How long in [seconds] our pitch must remain below PITCH_FLAT_THRESHOLD_RAD before the command
+ // ends.
+ public static double SETTLE_DEBOUNCE_SECONDS = 0.15;
+
+ public static double APPROACH_TIMEOUT_SECONDS = 4.0;
+
+ // 6.0 seconds is already very generous
+ public static double TOTAL_TIMEOUT_SECONDS = 8.0;
+
+ // When pitch velocity drops below this value (near zero or negative),
+ // the robot is at or past the peak.
+ public static double PITCH_PEAK_VELOCITY_THRESHOLD_RAD_PER_SEC = Units.degreesToRadians(0.5);
+ }
+
+ // ----------------------------------Begin Here------------------------------//
+
+ private final SwerveSubsystem drive;
+ private final CrossDirection direction;
+
+ // +1 for TO_NEUTRAL, -1 for TO_ALLIANCE.
+ private double driveSign;
+ private double pitchSign;
+
+ private BumpState state = BumpState.APPROACHING;
+
+ // Peak pitch magnitude observed during the CLIMBING phase (radians).
+ private double peakPitchRad = 0.0;
+
+ // Timer started when the command begins, used for both timeouts.
+ private final Timer totalTimer = new Timer();
+
+ /** Timer started when APPROACHING begins, used for approach timeout. */
+ private final Timer approachTimer = new Timer();
+
+ // I'm sure there are better ways to do this but I have familiairty with debouncers
+ private final Debouncer flatDebouncer =
+ new Debouncer(BumpConstants.SETTLE_DEBOUNCE_SECONDS, DebounceType.kRising);
+
+ // Signing of this command is decided in construction time (not part of state machine)
+ public CrossBumpCommand(SwerveSubsystem drive, CrossDirection direction) {
+ this.drive = drive;
+ this.direction = direction;
+ // Don't add in the drive sign early into construction, FMS not ready
+ addRequirements(drive);
+ }
+
+ @Override
+ public void initialize() {
+ state = BumpState.APPROACHING;
+ peakPitchRad = 0.0;
+
+ totalTimer.reset();
+ totalTimer.start();
+ approachTimer.reset();
+ approachTimer.start();
+
+ // Reset debouncer to ensure it starts in the not-debounced state
+ flatDebouncer.calculate(false);
+
+ Optional>
+ @SuppressWarnings("unchecked")
+ private final ArrayList