diff --git a/Writerside/topics/pplib-Build-an-Auto.md b/Writerside/topics/pplib-Build-an-Auto.md index d979519e..631a0a84 100644 --- a/Writerside/topics/pplib-Build-an-Auto.md +++ b/Writerside/topics/pplib-Build-an-Auto.md @@ -432,7 +432,7 @@ class RobotContainer: > **Note** > -> This feature is only available in the Java version of PathPlannerLib +> This feature is only available in the Java and Python versions of PathPlannerLib > {style="note"} @@ -471,4 +471,23 @@ public class RobotContainer { } ``` - \ No newline at end of file +```Python +from pathplannerlib.auto import AutoBuilder + +class RobotContainer: + + def __init__(): + + # Build an auto chooser. This will use Commands.none() as the default option. + self.autoChooser = AutoBuilder.buildAutoChooser() + + # Another option that allows you to specify the default auto by its name + # self.autoChooser = AutoBuilder.buildAutoChooser("My Default Auto") + + SmartDashboard.putData("Auto Chooser", self.autoChooser) + + def getAutonomousCommand(): + return self.autoChooser.getSelected() +``` + +