]> git.taranathan.com Git - FRC2026.git/commitdiff
trying stuff
authoreileha <eileenhan369@gmail.com>
Sat, 31 Jan 2026 19:44:55 +0000 (11:44 -0800)
committereileha <eileenhan369@gmail.com>
Sat, 31 Jan 2026 19:44:55 +0000 (11:44 -0800)
src/main/deploy/pathplanner/paths/Example Path.path [new file with mode: 0644]
src/main/java/frc/robot/RobotContainer.java

diff --git a/src/main/deploy/pathplanner/paths/Example Path.path b/src/main/deploy/pathplanner/paths/Example Path.path
new file mode 100644 (file)
index 0000000..8cb5742
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "version": "2025.0",
+  "waypoints": [
+    {
+      "anchor": {
+        "x": 6.73143534994069,
+        "y": 6.514994068801898
+      },
+      "prevControl": null,
+      "nextControl": {
+        "x": 7.0757295373665485,
+        "y": 5.621981020166073
+      },
+      "isLocked": false,
+      "linkedName": null
+    },
+    {
+      "anchor": {
+        "x": 7.710521945432978,
+        "y": 4.8795966785290625
+      },
+      "prevControl": {
+        "x": 7.1295255041518395,
+        "y": 5.6112218268090155
+      },
+      "nextControl": null,
+      "isLocked": false,
+      "linkedName": null
+    }
+  ],
+  "rotationTargets": [],
+  "constraintZones": [],
+  "pointTowardsZones": [],
+  "eventMarkers": [
+    {
+      "name": "Index",
+      "waypointRelativePos": 0.5894263217097863,
+      "endWaypointRelativePos": 1.0,
+      "command": {
+        "type": "named",
+        "data": {
+          "name": "Intake"
+        }
+      }
+    },
+    {
+      "name": "Index",
+      "waypointRelativePos": 0.589426321709788,
+      "endWaypointRelativePos": 1.0,
+      "command": {
+        "type": "named",
+        "data": {
+          "name": "Index"
+        }
+      }
+    }
+  ],
+  "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": -6.7298911483521735
+  },
+  "useDefaultConstraints": true
+}
\ No newline at end of file
index 3dff779fd9287db8b5eec0aabbf48684d5c53617..5f0e062867a58ad4ccd49ac45dcfd0ac80957ce8 100644 (file)
@@ -7,6 +7,7 @@ import org.json.simple.parser.ParseException;
 import org.littletonrobotics.junction.Logger;
 
 import com.pathplanner.lib.auto.AutoBuilder;
+import com.pathplanner.lib.auto.NamedCommands;
 import com.pathplanner.lib.commands.PathPlannerAuto;
 
 import edu.wpi.first.math.geometry.Pose3d;
@@ -15,6 +16,7 @@ import edu.wpi.first.wpilibj.RobotController;
 import edu.wpi.first.wpilibj.livewindow.LiveWindow;
 import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 import edu.wpi.first.wpilibj2.command.Command;
+import edu.wpi.first.wpilibj2.command.InstantCommand;
 import frc.robot.commands.DoNothing;
 import frc.robot.commands.drive_comm.DefaultDriveCommand;
 import frc.robot.commands.vision.ShutdownAllPis;
@@ -26,6 +28,7 @@ import frc.robot.controls.Operator;
 import frc.robot.controls.PS5ControllerDriverConfig;
 import frc.robot.subsystems.drivetrain.Drivetrain;
 import frc.robot.subsystems.drivetrain.GyroIOPigeon2;
+import frc.robot.subsystems.indexer.Spindexer;
 import frc.robot.util.PathGroupLoader;
 import frc.robot.util.Vision.DetectedObject;
 import frc.robot.util.Vision.Vision;
@@ -44,6 +47,7 @@ public class RobotContainer {
   private Drivetrain drive = null;
   private Vision vision = null;
   private Command auto = new DoNothing();
+  private Spindexer spindexer = null;
 
   // Controllers are defined here
   private BaseDriverConfig driver = null;
@@ -81,6 +85,8 @@ public class RobotContainer {
         drive = new Drivetrain(vision, new GyroIOPigeon2());
         driver = new PS5ControllerDriverConfig(drive);
         operator = new Operator(drive);
+        // added indexer here for now
+        spindexer = new Spindexer();
 
         // Detected objects need access to the drivetrain
         DetectedObject.setDrive(drive);
@@ -142,7 +148,7 @@ public class RobotContainer {
   }
 
   public void registerCommands() {
-
+    NamedCommands.registerCommand("Index", new InstantCommand(() -> spindexer.run()));
   }
 
   public static BooleanSupplier getAllianceColorBooleanSupplier() {