diff --git a/src/main/deploy/pathplanner/autos/DepotTirer.auto b/src/main/deploy/pathplanner/autos/DepotTirer.auto index b277eb4..cc642b6 100644 --- a/src/main/deploy/pathplanner/autos/DepotTirer.auto +++ b/src/main/deploy/pathplanner/autos/DepotTirer.auto @@ -17,7 +17,13 @@ { "type": "named", "data": { - "name": null + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" } } ] @@ -32,13 +38,13 @@ { "type": "named", "data": { - "name": null + "name": "Limelighter" } }, { "type": "named", "data": { - "name": null + "name": "Lancer" } } ] diff --git a/src/main/deploy/pathplanner/autos/DepotTirerMur.auto b/src/main/deploy/pathplanner/autos/DepotTirerMur.auto index bc70cac..5df75ea 100644 --- a/src/main/deploy/pathplanner/autos/DepotTirerMur.auto +++ b/src/main/deploy/pathplanner/autos/DepotTirerMur.auto @@ -17,7 +17,13 @@ { "type": "named", "data": { - "name": null + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" } } ] @@ -32,19 +38,19 @@ { "type": "named", "data": { - "name": null + "name": "Limelighter" } }, { "type": "named", "data": { - "name": null + "name": "Lancer" } }, { "type": "named", "data": { - "name": null + "name": "TournerA180" } }, { @@ -56,13 +62,25 @@ { "type": "named", "data": { - "name": null + "name": "GrimperMur" } }, { "type": "named", "data": { - "name": null + "name": "MonterGrimpeur" + } + }, + { + "type": "path", + "data": { + "pathName": "MonterMur" + } + }, + { + "type": "named", + "data": { + "name": "DescendreGrimpeur" } } ] diff --git a/src/main/deploy/pathplanner/autos/DepotTirerReservoir.auto b/src/main/deploy/pathplanner/autos/DepotTirerReservoir.auto index 6ce4d12..abb0dfb 100644 --- a/src/main/deploy/pathplanner/autos/DepotTirerReservoir.auto +++ b/src/main/deploy/pathplanner/autos/DepotTirerReservoir.auto @@ -17,7 +17,13 @@ { "type": "named", "data": { - "name": null + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" } } ] @@ -32,19 +38,19 @@ { "type": "named", "data": { - "name": null + "name": "Limelighter" } }, { "type": "named", "data": { - "name": null + "name": "Lancer" } }, { "type": "named", "data": { - "name": null + "name": "TournerAZero" } }, { @@ -56,13 +62,25 @@ { "type": "named", "data": { - "name": null + "name": "GrimperReservoir" } }, { "type": "named", "data": { - "name": null + "name": "MonterGrimpeur" + } + }, + { + "type": "path", + "data": { + "pathName": "MonterReservoir" + } + }, + { + "type": "named", + "data": { + "name": "DescendreGrimpeur" } } ] diff --git a/src/main/deploy/pathplanner/autos/MilieuDroite.auto b/src/main/deploy/pathplanner/autos/MilieuDroite.auto new file mode 100644 index 0000000..45028a2 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/MilieuDroite.auto @@ -0,0 +1,56 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "ChercherMilieuDroite" + } + }, + { + "type": "named", + "data": { + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "RetourMilieuDroite" + } + }, + { + "type": "named", + "data": { + "name": "Limelighter" + } + }, + { + "type": "named", + "data": { + "name": "Lancer" + } + } + ] + } + }, + "resetOdom": true, + "folder": "Milieu", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/MilieuDroiteProche.auto b/src/main/deploy/pathplanner/autos/MilieuDroiteProche.auto new file mode 100644 index 0000000..3be46e4 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/MilieuDroiteProche.auto @@ -0,0 +1,62 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "ChercherMilieuDroiteProche" + } + }, + { + "type": "named", + "data": { + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "PartirMilieuDroiteProche" + } + }, + { + "type": "named", + "data": { + "name": "RetourMilieuDroite" + } + }, + { + "type": "named", + "data": { + "name": "Limelighter" + } + }, + { + "type": "named", + "data": { + "name": "Lancer" + } + } + ] + } + }, + "resetOdom": true, + "folder": "Milieu", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/MilieuGauche.auto b/src/main/deploy/pathplanner/autos/MilieuGauche.auto new file mode 100644 index 0000000..c94ab13 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/MilieuGauche.auto @@ -0,0 +1,56 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "ChercherMilieuGauche" + } + }, + { + "type": "named", + "data": { + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "RetourMilieuGauche" + } + }, + { + "type": "named", + "data": { + "name": "Limelighter" + } + }, + { + "type": "named", + "data": { + "name": "Lancer" + } + } + ] + } + }, + "resetOdom": true, + "folder": "Milieu", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/MilieuGaucheProche.auto b/src/main/deploy/pathplanner/autos/MilieuGaucheProche.auto new file mode 100644 index 0000000..a5f7b5e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/MilieuGaucheProche.auto @@ -0,0 +1,62 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "ChercherMilieuGaucheProche" + } + }, + { + "type": "named", + "data": { + "name": "DescendreBalayeuse" + } + }, + { + "type": "named", + "data": { + "name": "Aspirer" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "PartirMilieuGaucheProche" + } + }, + { + "type": "named", + "data": { + "name": "RetourMilieuGauche" + } + }, + { + "type": "named", + "data": { + "name": "Limelighter" + } + }, + { + "type": "named", + "data": { + "name": "Lancer" + } + } + ] + } + }, + "resetOdom": true, + "folder": "Milieu", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/TirSimple.auto b/src/main/deploy/pathplanner/autos/TirSimple.auto index 72de8b8..48c2566 100644 --- a/src/main/deploy/pathplanner/autos/TirSimple.auto +++ b/src/main/deploy/pathplanner/autos/TirSimple.auto @@ -13,13 +13,13 @@ { "type": "named", "data": { - "name": null + "name": "Limelighter" } }, { "type": "named", "data": { - "name": null + "name": "Lancer" } } ] diff --git a/src/main/deploy/pathplanner/paths/ChercherMilieuDroite.path b/src/main/deploy/pathplanner/paths/ChercherMilieuDroite.path new file mode 100644 index 0000000..7d09afc --- /dev/null +++ b/src/main/deploy/pathplanner/paths/ChercherMilieuDroite.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.026, + "y": 0.685 + }, + "prevControl": null, + "nextControl": { + "x": 8.399509272467903, + "y": 0.7238159771754633 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.295877318116975, + "y": 1.238 + }, + "prevControl": { + "x": 8.295877318116975, + "y": 0.48503351833476316 + }, + "nextControl": { + "x": 8.295877318116975, + "y": 2.0013808844507857 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.295877318116975, + "y": 3.322 + }, + "prevControl": { + "x": 8.295877318116975, + "y": 2.2023305396701525 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.7420042643923158, + "rotationDegrees": 90.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, + "rotation": 90.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": 90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/ChercherMilieuDroiteProche.path b/src/main/deploy/pathplanner/paths/ChercherMilieuDroiteProche.path new file mode 100644 index 0000000..12b857c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/ChercherMilieuDroiteProche.path @@ -0,0 +1,89 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.000242510699001, + "y": 0.6515406562054205 + }, + "prevControl": null, + "nextControl": { + "x": 5.772958630527817, + "y": 0.6310199714693305 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.0057346647646215, + "y": 1.2725962910128386 + }, + "prevControl": { + "x": 6.0057346647646215, + "y": 0.5196298093476017 + }, + "nextControl": { + "x": 6.0057346647646215, + "y": 2.0359771754636244 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.8, + "y": 3.322 + }, + "prevControl": { + "x": 5.8, + "y": 2.2023305396701525 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.7420042643923158, + "rotationDegrees": 90.0 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0, + "maxWaypointRelativePos": 0.7292370020256648, + "constraints": { + "maxVelocity": 1.0, + "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": 90.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": 90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/ChercherMilieuGauche.path b/src/main/deploy/pathplanner/paths/ChercherMilieuGauche.path new file mode 100644 index 0000000..85fc743 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/ChercherMilieuGauche.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.026119828815976, + "y": 7.314950071326677 + }, + "prevControl": null, + "nextControl": { + "x": 8.399629101283878, + "y": 7.35376604850214 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.295877318116975, + "y": 6.771526390870186 + }, + "prevControl": { + "x": 8.295877318116975, + "y": 7.524492872535423 + }, + "nextControl": { + "x": 8.295877318116975, + "y": 6.0081455064194005 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.295877318116975, + "y": 4.688402282453637 + }, + "prevControl": { + "x": 8.32422939366089, + "y": 5.807712722058167 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.7420042643923158, + "rotationDegrees": -90.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, + "rotation": -90.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/ChercherMilieuGaucheProche.path b/src/main/deploy/pathplanner/paths/ChercherMilieuGaucheProche.path new file mode 100644 index 0000000..86500a1 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/ChercherMilieuGaucheProche.path @@ -0,0 +1,89 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.064935805991441, + "y": 7.392582025677603 + }, + "prevControl": null, + "nextControl": { + "x": 5.617574893009986, + "y": 7.314950071326676 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.915164051355206, + "y": 6.758587731811698 + }, + "prevControl": { + "x": 5.915164051355206, + "y": 7.511554213476935 + }, + "nextControl": { + "x": 5.915164051355206, + "y": 5.995206847360913 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.8, + "y": 4.688402282453637 + }, + "prevControl": { + "x": 5.828352075543914, + "y": 5.807712722058167 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.7420042643923158, + "rotationDegrees": -90.0 + } + ], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.8426738690074239, + "constraints": { + "maxVelocity": 1.0, + "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": -90.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/MonterMur.path b/src/main/deploy/pathplanner/paths/MonterMur.path new file mode 100644 index 0000000..5263779 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/MonterMur.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 1.0761055634807417, + "y": 4.85660485021398 + }, + "prevControl": null, + "nextControl": { + "x": 0.8292699165532256, + "y": 4.81695433438033 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.0761055634807417, + "y": 4.623708987161199 + }, + "prevControl": { + "x": 1.3604504533921022, + "y": 4.6356950204744996 + }, + "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": 180.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 180.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/MonterReservoir.path b/src/main/deploy/pathplanner/paths/MonterReservoir.path new file mode 100644 index 0000000..64b0950 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/MonterReservoir.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 1.0502282453637657, + "y": 2.4758915834522113 + }, + "prevControl": null, + "nextControl": { + "x": 1.0408884389937225, + "y": 2.742159765250622 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.0502282453637657, + "y": 2.7734807417974334 + }, + "prevControl": { + "x": 1.0547546338516156, + "y": 2.523521721541598 + }, + "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": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/PartirMilieuDroiteProche.path b/src/main/deploy/pathplanner/paths/PartirMilieuDroiteProche.path new file mode 100644 index 0000000..9588b1b --- /dev/null +++ b/src/main/deploy/pathplanner/paths/PartirMilieuDroiteProche.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.8, + "y": 3.322 + }, + "prevControl": null, + "nextControl": { + "x": 6.486128029253273, + "y": 1.6749552651197097 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.820870185449357, + "y": 0.8714978601997154 + }, + "prevControl": { + "x": 6.300963707518119, + "y": 2.122306196505451 + }, + "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": 180.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": 90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/PartirMilieuGaucheProche.path b/src/main/deploy/pathplanner/paths/PartirMilieuGaucheProche.path new file mode 100644 index 0000000..d4729fe --- /dev/null +++ b/src/main/deploy/pathplanner/paths/PartirMilieuGaucheProche.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.8, + "y": 4.688402282453637 + }, + "prevControl": null, + "nextControl": { + "x": 6.22710768166824, + "y": 6.07993837753099 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.963195435092723, + "y": 6.913851640513553 + }, + "prevControl": { + "x": 6.833040037863721, + "y": 6.563509208473397 + }, + "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": 180.0 + }, + "reversed": false, + "folder": "Milieu", + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/settings.json b/src/main/deploy/pathplanner/settings.json new file mode 100644 index 0000000..3e5f363 --- /dev/null +++ b/src/main/deploy/pathplanner/settings.json @@ -0,0 +1,36 @@ +{ + "robotWidth": 0.9, + "robotLength": 0.9, + "holonomicMode": true, + "pathFolders": [ + "Milieu" + ], + "autoFolders": [ + "Milieu" + ], + "defaultMaxVel": 3.0, + "defaultMaxAccel": 3.0, + "defaultMaxAngVel": 540.0, + "defaultMaxAngAccel": 720.0, + "defaultNominalVoltage": 12.0, + "robotMass": 74.088, + "robotMOI": 6.883, + "robotTrackwidth": 0.546, + "driveWheelRadius": 0.048, + "driveGearing": 5.143, + "maxDriveSpeed": 5.45, + "driveMotorType": "krakenX60", + "driveCurrentLimit": 60.0, + "wheelCOF": 1.2, + "flModuleX": 0.273, + "flModuleY": 0.273, + "frModuleX": 0.273, + "frModuleY": -0.273, + "blModuleX": -0.273, + "blModuleY": 0.273, + "brModuleX": -0.273, + "brModuleY": -0.273, + "bumperOffsetX": 0.0, + "bumperOffsetY": 0.0, + "robotFeatures": [] +} \ No newline at end of file diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index f9aeadb..ed33fb2 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,6 +4,8 @@ package frc.robot; +import com.pathplanner.lib.auto.NamedCommands; + import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; @@ -13,9 +15,18 @@ import frc.robot.commands.DescendreBalyeuse; import frc.robot.commands.DescendreGrimpeur; import frc.robot.commands.Lancer; import frc.robot.commands.LancerBaseVitesse; +import frc.robot.commands.Limelighter; import frc.robot.commands.ModeOposer; import frc.robot.commands.MonterBalyeuse; import frc.robot.commands.MonterGrimpeur; +import frc.robot.commands.ModeAuto.AspirerAuto; +import frc.robot.commands.ModeAuto.GrimperMur; +import frc.robot.commands.ModeAuto.GrimperReservoir; +import frc.robot.commands.ModeAuto.LancerAuto; +import frc.robot.commands.ModeAuto.RetourMilieuDroite; +import frc.robot.commands.ModeAuto.RetourMilieuGauche; +import frc.robot.commands.ModeAuto.TournerA180; +import frc.robot.commands.ModeAuto.TournerAZero; import frc.robot.subsystems.Balayeuse; import frc.robot.subsystems.Grimpeur; import frc.robot.subsystems.Lanceur; @@ -32,6 +43,18 @@ public class RobotContainer { public RobotContainer() { CameraServer.startAutomaticCapture(); configureBindings(); + NamedCommands.registerCommand("GrimperMur", new GrimperMur()); + NamedCommands.registerCommand("GrimperReservoir", new GrimperReservoir()); + NamedCommands.registerCommand("Lancer", new LancerAuto(lanceur)); + NamedCommands.registerCommand("RetourMilieuDroite", new RetourMilieuDroite()); + NamedCommands.registerCommand("RetourMilieuGauche", new RetourMilieuGauche()); + NamedCommands.registerCommand("Limelighter", new Limelighter()); + NamedCommands.registerCommand("DescendreBalayeuse", new DescendreBalyeuse(balayeuse)); + NamedCommands.registerCommand("Aspirer", new AspirerAuto(balayeuse)); + NamedCommands.registerCommand("TournerAZero", new TournerAZero()); + NamedCommands.registerCommand("TournerA180", new TournerA180()); + NamedCommands.registerCommand("MonterGrimpeur", new MonterGrimpeur(grimpeur)); + NamedCommands.registerCommand("DescendreGrimpeur", new DescendreGrimpeur(grimpeur)); } private void configureBindings() { diff --git a/src/main/java/frc/robot/commands/Limelighter.java b/src/main/java/frc/robot/commands/Limelighter.java new file mode 100644 index 0000000..1f409ef --- /dev/null +++ b/src/main/java/frc/robot/commands/Limelighter.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class Limelighter extends Command { + /** Creates a new Limelighter. */ + public Limelighter() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/AspirerAuto.java b/src/main/java/frc/robot/commands/ModeAuto/AspirerAuto.java new file mode 100644 index 0000000..9cfa5fb --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/AspirerAuto.java @@ -0,0 +1,41 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.Balayeuse; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class AspirerAuto extends Command { + Balayeuse balayeuse; + /** Creates a new AspirerAuto. */ + public AspirerAuto(Balayeuse balayeuse) { + this.balayeuse = balayeuse; + addRequirements(balayeuse); + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + balayeuse.Balayer(0.5); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + balayeuse.Balayer(0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/GrimperReservoir.java b/src/main/java/frc/robot/commands/ModeAuto/GrimperReservoir.java new file mode 100644 index 0000000..571c454 --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/GrimperReservoir.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class GrimperReservoir extends Command { + /** Creates a new GrimperReservoir. */ + public GrimperReservoir() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/LancerAuto.java b/src/main/java/frc/robot/commands/ModeAuto/LancerAuto.java new file mode 100644 index 0000000..ee0ccb1 --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/LancerAuto.java @@ -0,0 +1,46 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.Lanceur; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class LancerAuto extends Command { + Lanceur lanceur; + Timer timer; + /** Creates a new LancerAuto. */ + public LancerAuto(Lanceur lanceur) { + this.lanceur = lanceur; + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + timer.start(); + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + lanceur.Lancer(0.5); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + lanceur.Lancer(0); + timer.reset(); + timer.stop(); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return timer.get() > 3; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuDroite.java b/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuDroite.java new file mode 100644 index 0000000..b01e9f4 --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuDroite.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class RetourMilieuDroite extends Command { + /** Creates a new RetourMilieu. */ + public RetourMilieuDroite() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuGauche.java b/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuGauche.java new file mode 100644 index 0000000..50d606b --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/RetourMilieuGauche.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class RetourMilieuGauche extends Command { + /** Creates a new RetourMilieuGauche. */ + public RetourMilieuGauche() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/TournerA180.java b/src/main/java/frc/robot/commands/ModeAuto/TournerA180.java new file mode 100644 index 0000000..3471f10 --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/TournerA180.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class TournerA180 extends Command { + /** Creates a new TournerA180. */ + public TournerA180() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/ModeAuto/TournerAZero.java b/src/main/java/frc/robot/commands/ModeAuto/TournerAZero.java new file mode 100644 index 0000000..6b2886c --- /dev/null +++ b/src/main/java/frc/robot/commands/ModeAuto/TournerAZero.java @@ -0,0 +1,33 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands.ModeAuto; + +import edu.wpi.first.wpilibj2.command.Command; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class TournerAZero extends Command { + /** Creates a new TournerAZero. */ + public TournerAZero() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +}