From: GLRoylance Date: Thu, 12 Feb 2026 19:27:31 +0000 (-0800) Subject: Rename chooserInit() to autoChooserInit() X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=0b14555bb26d166f257a5e17a6a1c04870d5ad4f;p=FRC2026.git Rename chooserInit() to autoChooserInit() --- diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 4e4abc2..d109870 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -52,9 +52,8 @@ public class RobotContainer { private BaseDriverConfig driver = null; private Operator operator = null; - // Auto + // Auto Command selection private final SendableChooser autoChooser = new SendableChooser<>(); - private Command autoSelected; /** * The container for the robot. Contains subsystems, OI devices, and commands. @@ -66,7 +65,7 @@ public class RobotContainer { SmartDashboard.putString("RobotID", robotId.toString()); // Filling the SendableChooser on SmartDashboard - chooserInit(); + autoChooserInit(); // dispatch on the robot switch (robotId) { @@ -130,14 +129,6 @@ public class RobotContainer { SmartDashboard.putData("Shutdown Orange Pis", new ShutdownAllPis()); } - public void chooserInit(){ - autoChooser.setDefaultOption("Do nothing", new DoNothing()); - autoChooser.addOption("Do nada", new DoNothing()); - autoChooser.addOption("Spin my wheels", new DoNothing()); - autoChooser.addOption("Hello world", new InstantCommand(() -> System.out.println("Hello world"))); - SmartDashboard.putData("Auto chooser", autoChooser); - } - /** * Sets whether the drivetrain uses vision toupdate odometry */ @@ -193,14 +184,29 @@ public class RobotContainer { // Autos + /** + * Initialize the SendableChooser on the SmartDashbboard. + * Fill the SendableChooser with available Commands. + */ + public void autoChooserInit() { + // add the options to the Chooser + autoChooser.setDefaultOption("Do nothing", new DoNothing()); + autoChooser.addOption("Do nada", new DoNothing()); + autoChooser.addOption("Spin my wheels", new DoNothing()); + autoChooser.addOption("Hello world", new InstantCommand(() -> System.out.println("Hello world"))); + // put the Chooser on the SmartDashboard + SmartDashboard.putData("Auto chooser", autoChooser); + } /** * Gets the auto command from SmartDashboard * @return */ - public Command getAutoCommand(){ - autoSelected = autoChooser.getSelected(); + public Command getAutoCommand() { + // get the selected Command + Command autoSelected = autoChooser.getSelected(); + return autoSelected; }