Skip to content

Commit

Permalink
Fixed simulation on non-Phoenix robots (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrownGenius authored Feb 2, 2024
1 parent 557fc93 commit 64f7c06
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class RobotContainer {
public final ShooterSubsystem shooter;
public final IntakeBase intake;
public final DriveBase drive;
private final SendableChooser<Command> autoChooser;
private SendableChooser<Command> autoChooser = null;

public enum RobotModel {
PHOENIX, // Practice Swerve Bot
Expand Down Expand Up @@ -83,17 +83,17 @@ public RobotContainer() {
switch (driveType) {
case SWERVE:
drive = new DriveSwerveYAGSL();
autoChooser = AutoBuilder.buildAutoChooser("Mobility Auto");
SmartDashboard.putData("Auto Chooser", autoChooser);
break;
case TANK:
drive = null;
drive = new DriveBase();
break;
default:
drive = null;
drive = new DriveBase();
}

configureBindings();
autoChooser = AutoBuilder.buildAutoChooser("Mobility Auto");
SmartDashboard.putData("Auto Chooser", autoChooser);
}

private void configureBindings() {
Expand Down Expand Up @@ -130,6 +130,10 @@ private void configureBindings() {
}

public Command getAutonomousCommand() {
return autoChooser.getSelected();
if (autoChooser != null) {
return autoChooser.getSelected();
} else {
return null;
}
}
}

0 comments on commit 64f7c06

Please sign in to comment.