diff --git a/src/main/deploy/pathplanner/autos/Robot Reveal Night.auto b/src/main/deploy/pathplanner/autos/HubCenter-1Score.auto similarity index 93% rename from src/main/deploy/pathplanner/autos/Robot Reveal Night.auto rename to src/main/deploy/pathplanner/autos/HubCenter-1Score.auto index ddb4f8a..4792b69 100644 --- a/src/main/deploy/pathplanner/autos/Robot Reveal Night.auto +++ b/src/main/deploy/pathplanner/autos/HubCenter-1Score.auto @@ -19,7 +19,7 @@ { "type": "path", "data": { - "pathName": "Quick Shoot" + "pathName": "Center-Hub-Shoot" } }, { diff --git a/src/main/deploy/pathplanner/autos/HubCenter-2Score (side).auto b/src/main/deploy/pathplanner/autos/HubCenter-2Score (side).auto new file mode 100644 index 0000000..cd42020 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/HubCenter-2Score (side).auto @@ -0,0 +1,73 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "Intake Retracted" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Hub-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-ToDepot" + } + }, + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "Depot-Intake-Shoot (side)" + } + }, + { + "type": "named", + "data": { + "name": "Intake Retracted" + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/HubCenter-2Score (straight).auto b/src/main/deploy/pathplanner/autos/HubCenter-2Score (straight).auto new file mode 100644 index 0000000..89837a2 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/HubCenter-2Score (straight).auto @@ -0,0 +1,73 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "Intake Retracted" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Hub-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-ToDepot" + } + }, + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "Depot-Intake-Shoot (straight)" + } + }, + { + "type": "named", + "data": { + "name": "Intake Retracted" + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Test- Robot Align Path.auto b/src/main/deploy/pathplanner/autos/HubFarRight-Push-1Score.auto similarity index 72% rename from src/main/deploy/pathplanner/autos/Test- Robot Align Path.auto rename to src/main/deploy/pathplanner/autos/HubFarRight-Push-1Score.auto index 6c7bc18..7111298 100644 --- a/src/main/deploy/pathplanner/autos/Test- Robot Align Path.auto +++ b/src/main/deploy/pathplanner/autos/HubFarRight-Push-1Score.auto @@ -4,6 +4,18 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "HubFarRight-NeutralZone" + } + }, { "type": "named", "data": { @@ -13,13 +25,7 @@ { "type": "path", "data": { - "pathName": "Quick Shoot" - } - }, - { - "type": "path", - "data": { - "pathName": "Test - Robot Align" + "pathName": "HubFarLeft-Shoot" } }, { diff --git a/src/main/deploy/pathplanner/autos/Lidar Intake.auto b/src/main/deploy/pathplanner/autos/HubFarRight-Push.auto similarity index 60% rename from src/main/deploy/pathplanner/autos/Lidar Intake.auto rename to src/main/deploy/pathplanner/autos/HubFarRight-Push.auto index 0e1376a..f6d2adb 100644 --- a/src/main/deploy/pathplanner/autos/Lidar Intake.auto +++ b/src/main/deploy/pathplanner/autos/HubFarRight-Push.auto @@ -7,7 +7,13 @@ { "type": "named", "data": { - "name": "Lidar Intake" + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "HubFarRight-NeutralZone" } } ] diff --git a/src/main/deploy/pathplanner/autos/Taxi.auto b/src/main/deploy/pathplanner/autos/Taxi.auto deleted file mode 100644 index db06ab4..0000000 --- a/src/main/deploy/pathplanner/autos/Taxi.auto +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "Taxi" - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Quick Shoot.path b/src/main/deploy/pathplanner/paths/Center-Hub-Shoot.path similarity index 81% rename from src/main/deploy/pathplanner/paths/Quick Shoot.path rename to src/main/deploy/pathplanner/paths/Center-Hub-Shoot.path index 36bd07b..30b94a0 100644 --- a/src/main/deploy/pathplanner/paths/Quick Shoot.path +++ b/src/main/deploy/pathplanner/paths/Center-Hub-Shoot.path @@ -33,11 +33,11 @@ "pointTowardsZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 0.5, - "maxAcceleration": 3.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, "unlimited": false }, "goalEndState": { @@ -50,5 +50,5 @@ "velocity": 0, "rotation": 180.0 }, - "useDefaultConstraints": false + "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Test - Robot Align.path b/src/main/deploy/pathplanner/paths/Center-ToDepot.path similarity index 64% rename from src/main/deploy/pathplanner/paths/Test - Robot Align.path rename to src/main/deploy/pathplanner/paths/Center-ToDepot.path index 0b4c861..cf2aee7 100644 --- a/src/main/deploy/pathplanner/paths/Test - Robot Align.path +++ b/src/main/deploy/pathplanner/paths/Center-ToDepot.path @@ -8,20 +8,20 @@ }, "prevControl": null, "nextControl": { - "x": 2.526567580029336, - "y": 4.248584319077823 + "x": 2.490418422348576, + "y": 4.249816319262193 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 2.5, - "y": 4.7 + "x": 2.115, + "y": 6.0 }, "prevControl": { - "x": 2.5175324328959037, - "y": 4.450615530161258 + "x": 2.1584120444167327, + "y": 5.753798061746948 }, "nextControl": null, "isLocked": false, @@ -33,16 +33,16 @@ "pointTowardsZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 0.5, - "maxAcceleration": 3.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, "unlimited": false }, "goalEndState": { "velocity": 0, - "rotation": 180.0 + "rotation": -178.85423716182484 }, "reversed": false, "folder": null, @@ -50,5 +50,5 @@ "velocity": 0, "rotation": 180.0 }, - "useDefaultConstraints": false + "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Depot-Intake-Shoot (side).path b/src/main/deploy/pathplanner/paths/Depot-Intake-Shoot (side).path new file mode 100644 index 0000000..583ca74 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Depot-Intake-Shoot (side).path @@ -0,0 +1,97 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.115, + "y": 6.0 + }, + "prevControl": null, + "nextControl": { + "x": 1.9425952380952385, + "y": 6.874773809523809 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.485, + "y": 6.972 + }, + "prevControl": { + "x": 0.4543797151601425, + "y": 7.437592646883011 + }, + "nextControl": { + "x": 0.5156202848398574, + "y": 6.50640735311699 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.485, + "y": 4.985190476190476 + }, + "prevControl": { + "x": 0.5545595169162219, + "y": 4.745062440329646 + }, + "nextControl": { + "x": 0.36614285714285816, + "y": 5.395499999999999 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.3960952380952394, + "y": 5.179547619047619 + }, + "prevControl": { + "x": 2.136952380952382, + "y": 4.898809523809524 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 0.5, + "y": 4.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.2, + "maxWaypointRelativePos": 2.3115107913668993, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 147.26477372789242 + }, + "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/Depot-Intake-Shoot (straight).path b/src/main/deploy/pathplanner/paths/Depot-Intake-Shoot (straight).path new file mode 100644 index 0000000..9ca773e --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Depot-Intake-Shoot (straight).path @@ -0,0 +1,81 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.115, + "y": 6.0 + }, + "prevControl": null, + "nextControl": { + "x": 1.8650000000000004, + "y": 6.0 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7, + "y": 5.95697619047619 + }, + "prevControl": { + "x": 0.9480694691784167, + "y": 5.987984874123494 + }, + "nextControl": { + "x": 0.4519305308215832, + "y": 5.925967506828887 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.5256666666666674, + "y": 5.093166666666666 + }, + "prevControl": { + "x": 2.2773032851162216, + "y": 5.064607417642443 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": -0.1, + "y": 6.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.08778625954198889, + "maxWaypointRelativePos": 0.8328244274809142, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 154.59228189105156 + }, + "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/Taxi.path b/src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path similarity index 57% rename from src/main/deploy/pathplanner/paths/Taxi.path rename to src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path index 497847e..f3ea130 100644 --- a/src/main/deploy/pathplanner/paths/Taxi.path +++ b/src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 3.62702380952381, - "y": 6.0 + "x": 4.0, + "y": 7.4 }, "prevControl": null, "nextControl": { - "x": 4.627023809523808, - "y": 6.0 + "x": 3.054750000000001, + "y": 7.565821428571429 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 2.180142857142858, - "y": 6.0 + "x": 2.4500833333333345, + "y": 5.363107142857143 }, "prevControl": { - "x": 1.180142857142858, - "y": 6.0 + "x": 2.6268600286299715, + "y": 5.53988383815378 }, "nextControl": null, "isLocked": false, @@ -33,22 +33,22 @@ "pointTowardsZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 1.0, - "maxAcceleration": 3.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, "unlimited": false }, "goalEndState": { "velocity": 0, - "rotation": 178.89829388479367 + "rotation": 146.30993247402023 }, "reversed": false, "folder": null, "idealStartingState": { "velocity": 0, - "rotation": 179.95980050207663 + "rotation": 180.0 }, - "useDefaultConstraints": false + "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone.path b/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone.path new file mode 100644 index 0000000..2815c96 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone.path @@ -0,0 +1,117 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.0, + "y": 0.6661428571428576 + }, + "prevControl": null, + "nextControl": { + "x": 4.999999999999995, + "y": 0.6661428571428576 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.663, + "y": 0.8712976190476196 + }, + "prevControl": { + "x": 7.713544609817508, + "y": 0.5725975891884018 + }, + "nextControl": { + "x": 7.578952380952382, + "y": 1.367988095238095 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.53, + "y": 7.4 + }, + "prevControl": { + "x": 7.779738811179202, + "y": 7.388575194058578 + }, + "nextControl": { + "x": 6.471233966716803, + "y": 7.448435388999068 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 4.0, + "y": 7.4 + }, + "prevControl": { + "x": 4.246995139395343, + "y": 7.438644548322825 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 6.75, + "y": 8.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.9056310679611663, + "maxWaypointRelativePos": 1.9091262135922324, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.4, + "y": 7.4 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 1.9728155339805904, + "maxWaypointRelativePos": 2.55, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 9.0, + "y": 1.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.025631067961170227, + "maxWaypointRelativePos": 0.6920388349514595, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 1.7, + "maxAcceleration": 2.0, + "maxAngularVelocity": 500.0, + "maxAngularAcceleration": 700.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 180.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/settings.json b/src/main/deploy/pathplanner/settings.json index 5bf438c..303ae14 100644 --- a/src/main/deploy/pathplanner/settings.json +++ b/src/main/deploy/pathplanner/settings.json @@ -2,13 +2,15 @@ "robotWidth": 0.9, "robotLength": 0.9, "holonomicMode": true, - "pathFolders": [], + "pathFolders": [ + "New Folder" + ], "autoFolders": [], - "defaultMaxVel": 3.0, - "defaultMaxAccel": 3.0, - "defaultMaxAngVel": 540.0, - "defaultMaxAngAccel": 720.0, - "defaultNominalVoltage": 12.0, + "defaultMaxVel": 1.7, + "defaultMaxAccel": 2.0, + "defaultMaxAngVel": 500.0, + "defaultMaxAngAccel": 700.0, + "defaultNominalVoltage": 10.0, "robotMass": 74.088, "robotMOI": 6.883, "robotTrackwidth": 0.546, diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index b722623..b6b511f 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -96,7 +96,7 @@ public class RobotContainer { private Command autoCommand; - private Command RobotIntakeExtended = new SequentialCommandGroup( + private Command IntakeExtended = new SequentialCommandGroup( new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Extended), m_robotIntake) ); @@ -162,7 +162,8 @@ public class RobotContainer { NamedCommands.registerCommand("Robot Intake Retracted", RobotIntakeRetracted); NamedCommands.registerCommand("Robot Shoot", RobotShoot); // NamedCommands.registerCommand("Lidar Intake", LidarIntake); - NamedCommands.registerCommand("Robot Intake Extended", RobotIntakeExtended); + NamedCommands.registerCommand("Intake Extended", IntakeExtended); + DriverStation.silenceJoystickConnectionWarning(true); diff --git a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java index 460ca01..f60da2a 100644 --- a/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java +++ b/src/main/java/frc4388/robot/subsystems/swerve/SwerveDrive.java @@ -344,7 +344,12 @@ public class SwerveDrive extends SubsystemBase implements Queryable { Rotation2d heading = new Rotation2d(rightStick.getX(), rightStick.getY());//.r otateBy(Rotation2d.fromDegrees(90)); - heading = heading.rotateBy(Rotation2d.fromDegrees(-90)); + if(TimesNegativeOne.isRed) { + heading = heading.rotateBy(Rotation2d.fromDegrees(-90)); + } else { + heading = heading.rotateBy(Rotation2d.fromDegrees(90)); + } + rotTarget = heading.getDegrees(); driveFieldAngle(leftStick, heading);