44
55package frc .robot ;
66
7+ import com .pathplanner .lib .auto .AutoBuilder ;
78import com .pathplanner .lib .auto .NamedCommands ;
89import edu .wpi .first .math .controller .ProfiledPIDController ;
910import edu .wpi .first .math .geometry .Pose2d ;
1415import edu .wpi .first .wpilibj .DriverStation ;
1516import edu .wpi .first .wpilibj .Filesystem ;
1617import edu .wpi .first .wpilibj .RobotBase ;
18+ import edu .wpi .first .wpilibj .smartdashboard .SendableChooser ;
19+ import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
1720import edu .wpi .first .wpilibj2 .command .Command ;
1821import edu .wpi .first .wpilibj2 .command .Commands ;
1922import edu .wpi .first .wpilibj2 .command .button .CommandXboxController ;
@@ -32,6 +35,8 @@ public class RobotContainer
3235 private final SwerveSubsystem drivebase = new SwerveSubsystem (new File (Filesystem .getDeployDirectory (),
3336 "swerve" ));
3437
38+ private final SendableChooser <Command > autoChooser ;
39+
3540 /**
3641 * Converts driver input into a field-relative ChassisSpeeds that is controlled by angular velocity.
3742 */
@@ -94,6 +99,9 @@ public RobotContainer()
9499 configureBindings ();
95100 DriverStation .silenceJoystickConnectionWarning (true );
96101 NamedCommands .registerCommand ("test" , Commands .print ("I EXIST" ));
102+
103+ autoChooser = AutoBuilder .buildAutoChooser ("TestAuto" );
104+ SmartDashboard .putData ("Auto Chooser" , autoChooser );
97105 }
98106
99107 /**
@@ -180,7 +188,8 @@ private void configureBindings()
180188 public Command getAutonomousCommand ()
181189 {
182190 // An example command will be run in autonomous
183- return drivebase .getAutonomousCommand ("TestAuto" );
191+ //return drivebase.getAutonomousCommand("TestAuto");
192+ return autoChooser .getSelected ();
184193 }
185194
186195 public void setMotorBrake (boolean brake )
0 commit comments