]> git.taranathan.com Git - FRC2026.git/commitdiff
added null checks
authoriefomit <timofei.stem@gmail.com>
Thu, 16 Apr 2026 23:32:21 +0000 (16:32 -0700)
committeriefomit <timofei.stem@gmail.com>
Thu, 16 Apr 2026 23:32:21 +0000 (16:32 -0700)
for sim to work

src/main/deploy/pathplanner/autos/New Auto.auto [deleted file]
src/main/java/frc/robot/RobotContainer.java

diff --git a/src/main/deploy/pathplanner/autos/New Auto.auto b/src/main/deploy/pathplanner/autos/New Auto.auto
deleted file mode 100644 (file)
index d4dfd7b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "version": "2025.0",
-  "command": {
-    "type": "sequential",
-    "data": {
-      "commands": [
-        {
-          "type": "named",
-          "data": {
-            "name": "Stop Hood Down"
-          }
-        },
-        {
-          "type": "named",
-          "data": {
-            "name": null
-          }
-        }
-      ]
-    }
-  },
-  "resetOdom": true,
-  "folder": null,
-  "choreoAuto": false
-}
\ No newline at end of file
index fa9b0d42eeb98807c4a3cdb1ad465670c05640d7..c928267af062180755187f76999302c5eb68db4f 100644 (file)
@@ -21,6 +21,7 @@ import edu.wpi.first.wpilibj2.command.Command;
 import edu.wpi.first.wpilibj2.command.CommandScheduler;
 import edu.wpi.first.wpilibj2.command.InstantCommand;
 import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
+import frc.robot.commands.DoNothing;
 import frc.robot.commands.LogCommand;
 import frc.robot.commands.drive_comm.DefaultDriveCommand;
 import frc.robot.commands.gpm.AutoShootCommand;
@@ -165,7 +166,9 @@ public class RobotContainer {
         // put the Chooser on the SmartDashboard
         SmartDashboard.putData("Auto chooser", autoChooser);
 
-        SmartDashboard.putData("Lock Shooting", new LockedShoot(turret, drive, hood, shooter));
+        if (turret != null && drive != null && hood != null && shooter != null) {
+          SmartDashboard.putData("Lock Shooting", new LockedShoot(turret, drive, hood, shooter));
+        }
 
         if (turret != null) {
           turret.setDefaultCommand(new Superstructure(turret, drive, hood, shooter, spindexer));
@@ -175,7 +178,9 @@ public class RobotContainer {
           CommandScheduler.getInstance().schedule(new BrownOutControl(shooter, spindexer, turret, intake, hood, drive));
         }
         
-        drive.setDefaultCommand(new DefaultDriveCommand(drive, driver));
+        if (drive != null && driver != null) {
+          drive.setDefaultCommand(new DefaultDriveCommand(drive, driver));
+        }
         break;
     }
 
@@ -338,6 +343,9 @@ public class RobotContainer {
   }
 
   public Command getDefaultAuto() {
+    if (spindexer == null || turret == null || hood == null || intake == null) {
+      return new DoNothing();
+    }
     ParallelCommandGroup defaultShoot = new ParallelCommandGroup(
       new RunSpindexer(spindexer, turret, hood, intake)
     );