Update to 2026.2.1, more auto code, more tag tracking code, pondering on the fly path generation

This commit is contained in:
2026-01-18 23:01:17 -05:00
parent e05415452c
commit 929dd81329
5 changed files with 175 additions and 3 deletions

View File

@@ -4,9 +4,13 @@
package frc.robot;
import com.pathplanner.lib.auto.AutoBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.PrintCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.constants.AutoConstants;
import frc.robot.constants.OIConstants;
import frc.robot.subsystems.Drivetrain;
@@ -15,11 +19,15 @@ public class RobotContainer {
private CommandXboxController driver;
private SendableChooser<Command> autoChooser;
public RobotContainer() {
drivetrain = new Drivetrain();
driver = new CommandXboxController(OIConstants.kDriverControllerPort);
autoChooser = AutoBuilder.buildAutoChooser();
configureBindings();
}
@@ -35,6 +43,10 @@ public class RobotContainer {
}
public Command getAutonomousCommand() {
return Commands.print("No autonomous command configured");
if(AutoConstants.kAutoConfigOk) {
return autoChooser.getSelected();
} else {
return new PrintCommand("Robot Config loading failed, autonomous disabled");
}
}
}