chooser moved to Robot.java

This commit is contained in:
Aarav
2023-02-25 14:11:31 -07:00
parent 2031ace204
commit b620098fdb
2 changed files with 7 additions and 7 deletions
+4 -1
View File
@@ -13,6 +13,7 @@ import java.io.PrintWriter;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import frc4388.utility.RobotTime;
@@ -41,7 +42,7 @@ public class Robot extends TimedRobot {
// autonomous chooser on the dashboard.
m_robotContainer = new RobotContainer();
SmartDashboard.putData("AutoPlayback Chooser", m_robotContainer.chooser);
}
/**
@@ -70,6 +71,8 @@ public class Robot extends TimedRobot {
@Override
public void disabledInit() {
m_robotTime.endMatchTime();
SmartDashboard.putData("AutoPlayback Chooser", m_robotContainer.chooser);
}
@Override
@@ -64,7 +64,7 @@ public class RobotContainer {
private final DeadbandedXboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
/* Autos */
private SendableChooser<Command> chooser = new SendableChooser<>();
public SendableChooser<Command> chooser = new SendableChooser<>();
private Command noAuto = new InstantCommand();
@@ -102,8 +102,6 @@ public class RobotContainer {
chooser.addOption("Red1PathWithBalance", red1PathWithBalance);
chooser.addOption("Taxi", taxi);
SmartDashboard.putData(chooser);
}
@@ -134,8 +132,8 @@ public class RobotContainer {
"Blue1Path.txt"))
.onFalse(new InstantCommand());
new JoystickButton(getDeadbandedDriverController(), XboxController.LEFT_BUMPER_BUTTON)
.onTrue(new JoystickPlayback(m_robotSwerveDrive, "Blue1Path.txt"));
// new JoystickButton(getDeadbandedDriverController(), XboxController.LEFT_BUMPER_BUTTON)
// .onTrue(new JoystickPlayback(m_robotSwerveDrive, "Blue1Path.txt"));
// * Operator Buttons
}
@@ -148,7 +146,6 @@ public class RobotContainer {
public Command getAutonomousCommand() {
return chooser.getSelected();
// return new InstantCommand();
}
public DeadbandedXboxController getDeadbandedDriverController() {