From a19fe726c55208d0cfadb7f1d1954016013232b9 Mon Sep 17 00:00:00 2001 From: Ronan-B Date: Sat, 18 Jan 2025 13:30:02 -0800 Subject: [PATCH] Auto stash before checking out "origin/drive-auto-testing" --- .../pathplanner/paths/DriveForward.path | 14 +-- .../deploy/pathplanner/paths/New Path.path | 86 +++++++++++++++++++ src/main/java/frc/robot/RobotContainer.java | 13 +-- 3 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 src/main/deploy/pathplanner/paths/New Path.path diff --git a/src/main/deploy/pathplanner/paths/DriveForward.path b/src/main/deploy/pathplanner/paths/DriveForward.path index 212478d..ba52bbc 100644 --- a/src/main/deploy/pathplanner/paths/DriveForward.path +++ b/src/main/deploy/pathplanner/paths/DriveForward.path @@ -8,7 +8,7 @@ }, "prevControl": null, "nextControl": { - "x": 2.425937499999999, + "x": 1.6759375, "y": 6.0 }, "isLocked": false, @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 1.6, + "x": 4.648, "y": 5.9878289473684205 }, "prevControl": { - "x": 2.1227384868421053, - "y": 5.99391447368421 + "x": 4.398, + "y": 5.9878289473684205 }, "nextControl": null, "isLocked": false, @@ -33,8 +33,8 @@ "pointTowardsZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 3.0, - "maxAcceleration": 3.0, + "maxVelocity": 5.5, + "maxAcceleration": 6.7, "maxAngularVelocity": 540.0, "maxAngularAcceleration": 720.0, "nominalVoltage": 12.0, @@ -50,5 +50,5 @@ "velocity": 0, "rotation": 0.0 }, - "useDefaultConstraints": true + "useDefaultConstraints": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/New Path.path b/src/main/deploy/pathplanner/paths/New Path.path new file mode 100644 index 0000000..b030c88 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/New Path.path @@ -0,0 +1,86 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 1.884630681818182, + "y": 6.921747159090909 + }, + "prevControl": null, + "nextControl": { + "x": 2.134630681818182, + "y": 6.921747159090909 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 4.029, + "y": 6.922 + }, + "prevControl": { + "x": 3.779, + "y": 6.922 + }, + "nextControl": { + "x": 4.279, + "y": 6.922 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 4.029, + "y": 5.645383522727273 + }, + "prevControl": { + "x": 3.779, + "y": 5.645383522727273 + }, + "nextControl": { + "x": 4.279, + "y": 5.645383522727273 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.884630681818182, + "y": 5.645383522727273 + }, + "prevControl": { + "x": 1.6346306818181817, + "y": 5.645383522727273 + }, + "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/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index ae5d321..5847745 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -8,6 +8,11 @@ import com.ctre.phoenix6.SignalLogger; import com.ctre.phoenix6.swerve.SwerveRequest; +import com.pathplanner.lib.auto.AutoBuilder; +import com.pathplanner.lib.commands.FollowPathCommand; +import com.pathplanner.lib.path.PathPlannerPath; + +import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; @@ -95,10 +100,9 @@ private void initializeSubSystems() { } private void initAutoChooser() { - SmartDashboard.putData("Auto Chooser", m_chooser); - - m_chooser.addOption("Do Nothing", new WaitCommand(0)); - + SmartDashboard.putData("Auto Mode", m_chooser); + m_chooser.setDefaultOption("Do Nothing", new WaitCommand(0)); + m_chooser.addOption("DriveForward", new DriveForward(m_swerveDrive)); } @@ -177,7 +181,6 @@ private void configureBindings() { m_driverController.x().whileTrue(new RunAlgaeIntake(m_algaeIntake, 0.5)); // outtake m_driverController.y().whileTrue(new RunAlgaeIntake(m_algaeIntake, -0.5)); // intake } - /** * Use this to pass the autonomous command to the main {@link Robot} class. *