A competitive auto does more than drive -- it intakes, scores, and chains paths. PathPlanner's AutoBuilder plus named commands let you author that in the GUI and trigger your real subsystem commands at event markers along the path.
Step 1: Register named commands#
The string you register must be identical to the name you type in the PathPlanner GUI, and registration must happen before any auto or path is created -- the docs are explicit that a command registered after auto/path creation will not be used. Register in RobotContainer after subsystems are created:
NamedCommands.registerCommand("intake", m_intake.intakeUntilHasPiece());
NamedCommands.registerCommand("score", m_arm.scoreL4());
NamedCommands.registerCommand("stow", m_arm.stow());
Step 2: Configure AutoBuilder#
AutoBuilder needs to know how to read your pose, reset it, get robot-relative speeds, and drive robot-relative -- so it can follow paths and fire event markers automatically. In PathPlannerLib 2025 the path-following controller is passed as a single object (e.g. PPHolonomicDriveController built from translation and rotation PIDConstants):
AutoBuilder.configure(
m_swerve::getPose, // Supplier<Pose2d>
m_swerve::resetPose, // Consumer<Pose2d>
m_swerve::getRobotRelativeSpeeds, // Supplier<ChassisSpeeds>
(speeds, ff) -> m_swerve.driveRobotRelative(speeds), // drive + feedforwards
new PPHolonomicDriveController(
new PIDConstants(5.0, 0.0, 0.0), // translation
new PIDConstants(5.0, 0.0, 0.0)), // rotation
config, // RobotConfig (from GUI settings)
() -> DriverStation.getAlliance()
.orElse(Alliance.Blue) == Alliance.Red, // flip path for red
m_swerve);
Step 3: Build the auto#
Once AutoBuilder is configured, loading a saved .auto file is one line, and you can offer a chooser on the dashboard. buildAutoChooser("...") takes an optional default-auto name:
private final SendableChooser<Command> m_autoChooser =
AutoBuilder.buildAutoChooser("3-Piece Center");
// in robotInit / constructor:
SmartDashboard.putData("Auto", m_autoChooser);
public Command getAutonomousCommand() {
return m_autoChooser.getSelected();
}
Event markers do the coordination#
In the GUI you drop an event marker partway along a path and attach the named command intake. When PathPlannerLib follows that path, it fires the command at that point while continuing to drive -- so the robot intakes on the move instead of stopping. Wrap PathPlanner-invoked commands with .asProxy() if you don't want the path itself to be interrupted by a default command grabbing the subsystem.
Common gotcha#
If an event marker "does nothing," the cause is almost always a registered string that differs from the GUI string ("Intake" vs "intake"), or a command registered after building the auto. Register first, build second, and keep names identical.
Test the whole routine in simulation first, then on blocks with the wheels off the ground before a full field run.
the part worth keeping
Key takeaways
- Register named commands before creating any auto/path, with strings identical to the PathPlanner GUI.
- AutoBuilder.configure() takes pose getter/setter, a robot-relative speeds supplier, a drive consumer, a path-following controller, RobotConfig, an alliance-flip supplier, and the subsystem.
- Event markers fire your real commands mid-path so the robot acts while driving.
- Use buildAutoChooser() to pick autos from the dashboard, and .asProxy() to protect path commands from interruption.
Programming, Controls & SensorsWorked Examples and Mini-Projectslesson 4 of 5
Keep going
Take the quiz+10 XP with an accountMore in Worked Examples and Mini-Projects
where this came from
Sources and corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed, in public, in the corrections log.
sources and further reading
- pathplanner.devPathPlanner: Named Commands
- pathplanner.devPathPlanner: Build an Auto
- pathplanner.devPathPlannerLib AutoBuilder (Java API)
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
- 8 min readFRC Autonomous with PathPlanner: A Beginner's Guide to Auto RoutinesLearn how FRC teams build autonomous routines with PathPlanner (PPLib): paths vs autos, AutoBuilder, named commands, odometry, tuning, and Choreo./blogread it
- 12 min readChoreo vs PathPlanner: Planning FRC Autonomous TrajectoriesCompare Choreo and PathPlanner for FRC autonomous trajectories: how Choreo's time-optimal solver differs from PathPlanner's GUI paths, and when to use each./blogread it
- 13 min readFRC Code Structure Best Practices: Command-Based Project ArchitectureHow to structure an FRC command-based robot project the right way — subsystems, commands, RobotContainer, and Constants — verified against official WPILib docs./blogread it
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01Once AutoBuilder is configured, how are saved autos loaded and offered for selection on the dashboard?
02When must NamedCommands.registerCommand calls happen relative to loading paths/autos?
03What is the purpose of event markers placed along a PathPlanner path?
Answer every question to submit.
All 51 lessons in Programming, Controls & Sensorsopenclose
01 / prerequisites
02 / foundations-tools-and-first-program
03 / robot-program-and-command-based
04 / motors-and-control
05 / autonomous-trajectories-simulation
06 / sensing-fundamentals
07 / encoders
08 / gyros-imus-orientation
09 / closed-loop-control
10 / vision-pose-estimation
11 / worked-examples-mini-projects
- Not read yet:Mini-Project: A Closed-Loop Elevator with Motion Magic
- Not read yet:Mini-Project: A Velocity-Controlled Shooter on REVLib
- Not read yet:Mini-Project: A Teleop Swerve Drive Subsystem
- Not read yet:Mini-Project: An Autonomous Routine with PathPlanner
- Not read yet:Mini-Project: Vision-Aligned Scoring with Limelight
12 / common-mistakes-troubleshooting
13 / advanced-techniques-case-studies
- Not read yet:State-Space Control and Kalman Filtering
- Not read yet:Log Replay Architecture with AdvantageKit
- Not read yet:Advanced Pose Estimation: Multi-Tag Fusion and Standard Deviations
- Not read yet:Robot Coordination, Alerts, and Operator Feedback
- Not read yet:Case Study: Hardening Software Before an Event