Skip to content

Commit

Permalink
Added Python Sendablechooser Usage Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jserra7d5 authored Mar 11, 2024
1 parent 446914a commit f296b90
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Writerside/topics/pplib-Build-an-Auto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -471,4 +471,23 @@ public class RobotContainer {
}
```

</snippet>
```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()
```

</snippet>

0 comments on commit f296b90

Please sign in to comment.