Trajectories with PathPlanner and Choreo
Design smooth driving paths visually with PathPlanner or Choreo, then follow them in code.
Sign in to track progress, earn XP, and save lessons.
What a trajectory is
A trajectory is a time-parameterized path: at each moment it specifies where the robot should be and how fast it should be moving. A trajectory follower compares this to your odometry pose and commands ChassisSpeeds to stay on the path. Instead of hand-coding curves, teams use visual tools.
PathPlanner
PathPlanner (created by Michael Jansen) is the most widely used FRC path tool. It's a GUI where you place waypoints, drag Bézier-style control handles to shape curves, set rotation targets (great for swerve), and add event markers to trigger commands mid-path. Modern PathPlanner generates paths that largely "just work" with little tuning.
Install PathPlannerLib as a vendordep. The library's AutoBuilder turns saved paths and autos into commands:
// Configure AutoBuilder once (with your pose supplier, drive method, etc.),
// then load a full auto built in the GUI:
Command auto = new PathPlannerAuto("My Auto");
PathPlanner lets you build entire autonomous routines visually — paths plus the commands fired at event markers — and load them as a single command.
Choreo
Choreo (by the Sleipnir Group) is a time-optimal drivetrain trajectory planner: given your robot's real constraints (mass, motor limits, wheel grip), it solves for the fastest physically possible trajectory through your waypoints (its solver is built on TrajoptLib/Sleipnir). It's especially popular for swerve where squeezing out time matters.
Install ChoreoLib as a vendordep. Choreo and PathPlanner interoperate — you can load a Choreo trajectory through PathPlanner via PathPlannerPath.fromChoreoTrajectory(...), or use ChoreoLib directly.
ChoreoLib's auto tools
ChoreoLib provides higher-level helpers:
AutoFactory— builds auto routines from trajectories, either as command compositions (simple autos) or via theAutoRoutineclass (complex, branching autos).AutoChooser— sends your list of autos to the dashboard for pre-match selection. It lazy-loads routines and is the recommended chooser when using ChoreoLib (instead of the genericSendableChooser).
PathPlanner vs. Choreo
| PathPlanner | Choreo | |
|---|---|---|
| Style | Waypoints + manual handles | Solver finds optimal path |
| Strength | Fast iteration, event markers, full autos in GUI | Truly time-optimal trajectories |
| Tuning | Minimal | Define robot constraints once |
Many teams use both: PathPlanner for quick everyday paths and full-auto authoring, Choreo when they need the fastest possible route. Both are free, open-source, and well-documented.
The workflow
- Model your robot's dimensions/constraints in the tool.
- Draw the path on a field image and set rotations/markers.
- Save it into your project's
src/main/deployfolder. - Load and run it from your autonomous command.
Key takeaways
- A trajectory specifies position and velocity over time; a follower keeps the robot on it.
- PathPlanner is a GUI for waypoint paths, event markers, and full autos via AutoBuilder/PathPlannerAuto.
- Choreo computes time-optimal trajectories from your robot's physical constraints.
- PathPlanner and Choreo interoperate (PathPlannerPath.fromChoreoTrajectory); many teams use both.
- ChoreoLib's AutoFactory/AutoRoutine build autos; AutoChooser picks them at the dashboard.
Lesson quiz
RequiredAnswer all 3 questions correctly to complete this lesson.
1.In PathPlanner, what are the smooth robot paths primarily defined by?
2.A key advantage of Choreo over hand-tuning a PathPlanner path is that Choreo:
3.On holonomic (e.g., swerve) drivetrains, how does PathPlanner treat the robot's heading relative to its direction of travel?
Answer every question to submit.