]> git.taranathan.com Git - FRC2026.git/commitdiff
have brownout control run on startup instead of when touchpad is pressed, also protec...
authormoo <moogoesmeow123@gmail.com>
Wed, 25 Mar 2026 21:48:12 +0000 (14:48 -0700)
committermoo <moogoesmeow123@gmail.com>
Wed, 25 Mar 2026 21:48:12 +0000 (14:48 -0700)
sry i formatted robotcontainer

src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java

index fe64006ac8a073db57615b136e6f5a1cc302f3eb..af6f5c8c10f90e7228894ffc4e46738f63a42c54 100644 (file)
@@ -1,5 +1,6 @@
 package frc.robot;
 
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.BooleanSupplier;
 
 import org.littletonrobotics.junction.Logger;
@@ -19,8 +20,10 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
 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.ScheduleCommand;
 import frc.robot.commands.drive_comm.DefaultDriveCommand;
 import frc.robot.commands.gpm.AutoShootCommand;
+import frc.robot.commands.gpm.BrownOutControl;
 import frc.robot.commands.gpm.ClimbDriveCommand;
 import frc.robot.commands.gpm.HardstopWarning;
 import frc.robot.commands.gpm.IntakeMovementCommand;
@@ -65,7 +68,7 @@ public class RobotContainer {
   private Intake intake = null;
 
   // this is inside addAuto()
-  //private Command auto = new DoNothing();
+  // private Command auto = new DoNothing();
 
   // Controllers are defined here
   private BaseDriverConfig driver = null;
@@ -131,27 +134,29 @@ public class RobotContainer {
         driver.configureControls();
         operator.configureControls();
 
-      
         registerCommands();
         PathGroupLoader.loadPathGroups();
-        
+
         initializeAutoBuilder();
         autoChooserInit();
 
         // put the Chooser on the SmartDashboard
         SmartDashboard.putData("Auto chooser", autoChooser);
 
-        
-
         if (turret != null) {
           turret.setDefaultCommand(new Superstructure(turret, drive, hood, shooter, spindexer));
         }
+
+        if (shooter != null && spindexer != null && turret != null && intake != null && hood != null && drive != null) {
+          CommandScheduler.getInstance().schedule(new BrownOutControl(shooter, spindexer, turret, intake, hood, drive));
+        }
+        
         drive.setDefaultCommand(new DefaultDriveCommand(drive, driver));
         break;
     }
 
-       if (intake != null && hood != null && turret != null)
-               CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
+    if (intake != null && hood != null && turret != null)
+      CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
 
     // This is really annoying so it's disabled
     DriverStation.silenceJoystickConnectionWarning(true);
@@ -237,16 +242,16 @@ public class RobotContainer {
 
   }
 
-  public void addAuto(String name){
-    try{
+  public void addAuto(String name) {
+    try {
       Command auto = new PathPlannerAuto(name);
       autoChooser.addOption(name, auto);
     }
     // is this the right one??
     catch (AutoBuilderException e) {
-          e.printStackTrace();
-          System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
-        }
+      e.printStackTrace();
+      System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
+    }
   }
 
   /**
@@ -257,7 +262,7 @@ public class RobotContainer {
     // add the options to the Chooser
     String defaultAuto = "Test default auto";
     String leftSideAuto = "Left Week V1";
-    String rightSideAuto = "Right Week V1";      
+    String rightSideAuto = "Right Week V1";
     String shootOnlyAuto = "Shoot Only Left Week V1";
 
     autoChooser.setDefaultOption("Default", new PathPlannerAuto(defaultAuto));
index f20b0240e2dd4a8c943e0bc34a26ad79009c2285..b15d453c82a0473d538506bd8b221f9c910b7e09 100644 (file)
@@ -199,9 +199,9 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig {
         }
 
         // turns it on
-        controller.get(PS5Button.TOUCHPAD).onTrue(new InstantCommand(() -> {
-            new BrownOutControl(shooter, spindexer, turret, intake, hood, getDrivetrain());
-        }));
+    //     controller.get(PS5Button.TOUCHPAD).onTrue(new InstantCommand(() -> {
+    //         new BrownOutControl(shooter, spindexer, turret, intake, hood, getDrivetrain());
+    //     }));
     }
 
     @Override