From 49aecc9cae651cef272b85a8b9e444866690590c Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Tue, 23 Jan 2024 19:00:20 -0500 Subject: [PATCH] patplaner --- .pathplanner/settings.json | 12 +++- src/main/deploy/pathplanner/autos/2.auto | 31 +++++++++ src/main/deploy/pathplanner/autos/3.auto | 31 +++++++++ src/main/deploy/pathplanner/autos/4.auto | 18 +++++ src/main/deploy/pathplanner/autos/7.auto | 25 +++++++ src/main/deploy/pathplanner/paths/2.1.path | 49 ++++++++++++++ src/main/deploy/pathplanner/paths/2.2.path | 49 ++++++++++++++ src/main/deploy/pathplanner/paths/3.1.path | 49 ++++++++++++++ src/main/deploy/pathplanner/paths/3.2.path | 49 ++++++++++++++ src/main/deploy/pathplanner/paths/4.1.path | 65 +++++++++++++++++++ src/main/deploy/pathplanner/paths/7.path | 49 ++++++++++++++ .../java/frc/robot/subsystem/Guideur.java | 2 +- 12 files changed, 426 insertions(+), 3 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/2.auto create mode 100644 src/main/deploy/pathplanner/autos/3.auto create mode 100644 src/main/deploy/pathplanner/autos/4.auto create mode 100644 src/main/deploy/pathplanner/autos/7.auto create mode 100644 src/main/deploy/pathplanner/paths/2.1.path create mode 100644 src/main/deploy/pathplanner/paths/2.2.path create mode 100644 src/main/deploy/pathplanner/paths/3.1.path create mode 100644 src/main/deploy/pathplanner/paths/3.2.path create mode 100644 src/main/deploy/pathplanner/paths/4.1.path create mode 100644 src/main/deploy/pathplanner/paths/7.path diff --git a/.pathplanner/settings.json b/.pathplanner/settings.json index f34d3d1..6aafa9f 100644 --- a/.pathplanner/settings.json +++ b/.pathplanner/settings.json @@ -3,10 +3,18 @@ "robotLength": 0.9, "holonomicMode": true, "pathFolders": [ - "1" + "1", + "2", + "3", + "7", + "4" ], "autoFolders": [ - "1" + "1", + "2", + "3", + "7", + "4" ], "defaultMaxVel": 3.0, "defaultMaxAccel": 3.0, diff --git a/src/main/deploy/pathplanner/autos/2.auto b/src/main/deploy/pathplanner/autos/2.auto new file mode 100644 index 0000000..87988db --- /dev/null +++ b/src/main/deploy/pathplanner/autos/2.auto @@ -0,0 +1,31 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7, + "y": 4.4 + }, + "rotation": 120.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "2.1" + } + }, + { + "type": "path", + "data": { + "pathName": "2.2" + } + } + ] + } + }, + "folder": "2", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/3.auto b/src/main/deploy/pathplanner/autos/3.auto new file mode 100644 index 0000000..93406f2 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/3.auto @@ -0,0 +1,31 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7, + "y": 6.7 + }, + "rotation": -120.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "3.1" + } + }, + { + "type": "path", + "data": { + "pathName": "3.2" + } + } + ] + } + }, + "folder": "3", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/4.auto b/src/main/deploy/pathplanner/autos/4.auto new file mode 100644 index 0000000..d585e63 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/4.auto @@ -0,0 +1,18 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 2, + "y": 2 + }, + "rotation": 0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [] + } + }, + "folder": "4", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/7.auto b/src/main/deploy/pathplanner/autos/7.auto new file mode 100644 index 0000000..512be15 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/7.auto @@ -0,0 +1,25 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.35, + "y": 3.0 + }, + "rotation": 0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "7" + } + } + ] + } + }, + "folder": "7", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/2.1.path b/src/main/deploy/pathplanner/paths/2.1.path new file mode 100644 index 0000000..a676953 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/2.1.path @@ -0,0 +1,49 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.7, + "y": 4.4 + }, + "prevControl": null, + "nextControl": { + "x": 0.6894957404489546, + "y": 4.418193911238301 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.65, + "y": 4.1 + }, + "prevControl": { + "x": 2.6158093583592366, + "y": 4.1 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -179.40693596496888, + "rotateFast": false + }, + "reversed": false, + "folder": "2", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/2.2.path b/src/main/deploy/pathplanner/paths/2.2.path new file mode 100644 index 0000000..0696106 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/2.2.path @@ -0,0 +1,49 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.65, + "y": 4.1 + }, + "prevControl": null, + "nextControl": { + "x": 2.6706170787257038, + "y": 4.1 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7, + "y": 4.4 + }, + "prevControl": { + "x": 0.7125895024720742, + "y": 4.378194342076354 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 121.31253418670846, + "rotateFast": false + }, + "reversed": false, + "folder": "2", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/3.1.path b/src/main/deploy/pathplanner/paths/3.1.path new file mode 100644 index 0000000..3975f47 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/3.1.path @@ -0,0 +1,49 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.7, + "y": 6.7 + }, + "prevControl": null, + "nextControl": { + "x": 0.6993965107276529, + "y": 6.6989547259184725 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.7, + "y": 7.0 + }, + "prevControl": { + "x": 2.6949379619996434, + "y": 7.0 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 179.97207043158542, + "rotateFast": false + }, + "reversed": false, + "folder": "3", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/3.2.path b/src/main/deploy/pathplanner/paths/3.2.path new file mode 100644 index 0000000..422f580 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/3.2.path @@ -0,0 +1,49 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.7, + "y": 7.0 + }, + "prevControl": null, + "nextControl": { + "x": 2.710911765291465, + "y": 6.990576641485824 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7, + "y": 6.7 + }, + "prevControl": { + "x": 0.7125383894358018, + "y": 6.713974263386468 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -120.9841650982781, + "rotateFast": false + }, + "reversed": false, + "folder": "3", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/4.1.path b/src/main/deploy/pathplanner/paths/4.1.path new file mode 100644 index 0000000..ca790f1 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/4.1.path @@ -0,0 +1,65 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.0, + "y": 7.0 + }, + "prevControl": null, + "nextControl": { + "x": 3.0, + "y": 6.5 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.0, + "y": 5.0 + }, + "prevControl": { + "x": 4.0, + "y": 6.0 + }, + "nextControl": { + "x": 6.0, + "y": 4.0 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.0, + "y": 1.0 + }, + "prevControl": { + "x": 6.75, + "y": 2.5 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "rotateFast": false + }, + "reversed": false, + "folder": "4", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/7.path b/src/main/deploy/pathplanner/paths/7.path new file mode 100644 index 0000000..0bc88b8 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/7.path @@ -0,0 +1,49 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.35, + "y": 3.0 + }, + "prevControl": null, + "nextControl": { + "x": 1.3576779647621067, + "y": 2.993175772574823 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.2198817841816214, + "y": 3.0 + }, + "prevControl": { + "x": 3.20038226774791, + "y": 3.019499516433713 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "rotateFast": false + }, + "reversed": false, + "folder": "7", + "previewStartingState": null, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystem/Guideur.java b/src/main/java/frc/robot/subsystem/Guideur.java index 5a0282d..08ffab9 100644 --- a/src/main/java/frc/robot/subsystem/Guideur.java +++ b/src/main/java/frc/robot/subsystem/Guideur.java @@ -16,7 +16,7 @@ public class Guideur extends SubsystemBase { final WPI_TalonSRX guideur = new WPI_TalonSRX(Constants.guideur); final DigitalInput guideurhaut = new DigitalInput(Constants.guideurhaut); - final DigitalInput guideurbas = new DigitalInput(Constants.guideurhaut); + final DigitalInput guideurbas = new DigitalInput(Constants.guideurhaut); public void guider(double vitesse){ guideur.set(vitesse);