Heads up: WPILib 2027 is still in alpha. These pages are changing quickly and aren't stable or finished yet — expect edits as the APIs settle.
Gray Matter LogoGray Matter Workshop

Autonomous: Driving to a Pose

KEY CONCEPT

Autonomous Without PathPlanner

The 2027 template drives itself in autonomous with CTRE's on-board path tools, LinearPath and a DriveToPose command, instead of PathPlanner. A routine is just an @Autonomous OpMode that sequences DriveToPose legs (and mechanism commands) in code. No GUI, no vendor dependency, no AutoBuilder.

↳ TAKEAWAY

Autonomous = an @Autonomous OpMode that sequences DriveToPose legs. Each leg drives in a straight line to a field pose using CTRE LinearPath (a profiled feedforward) plus PID feedback on odometry.

The building block: DriveToPose

DriveToPose is a command that drives the robot in a straight line to a target field pose, on odometry. The feedforward comes from CTRE's LinearPath, a trajectory generator that produces a smooth trapezoid-profiled velocity toward the goal. Three PID controllers (X, Y, heading) trim the measured pose back onto the profile to cancel drift. You give it a goal Pose2d and it finishes when the profile is done.

Where the controller internals live

This page is about composing autonomous routines. The inside of the drive-to-a-pose command (the PID feedback, the profiled feedforward, and the field-frame math) is built up step by step on the Drive to Point lesson (basic, three PID controllers) and the Profiled Drive to Point lesson (the LinearPath feedforward version that DriveToPose uses).

An autonomous routine is an @Autonomous OpMode

Each autonomous routine is its own class tagged @Autonomous; the driver station lists them by name, and selecting one constructs it. You build the routine in the constructor with Command.sequence(...) (legs run one after another) and Command.parallel(...) (things happen together), schedule it in start(), and cancel it in end().

Want a second routine? Add another @Autonomousclass; it shows up as another choice on the driver station. To do something at a point in the path (the old "event marker"), chain a mechanism command into the sequence: a hold with a call-site .until(...), or Command.race(leg, hold) to hold a pose whiledriving. The team's worked example of exactly that pattern is DriveStowDriveChainedOpMode.java in the 2027-Template, alongside its AutonomousOpMode.java and DriveToPose.java.

Mixing in mechanism actions (the old "event markers")

Because legs are just commands, you can interleave superstructure actions with drive legs. Run the intake while driving, then score. Remember the intake and scoring presets are holds, so each one needs the right chaining tool:

Field frame & alliance

Poses are blue-alliance origin

Odometry (and therefore DriveToPose) works in the blue-alliance-origin field frame. The origin does not flip with alliance (this is the Phoenix convention), so write your poses for the blue side.

When you're on the red alliance, flip the goal poses to the red side rather than changing the origin. Keep one source of truth for the flip and apply it where you build the routine.

Seed your starting pose

DriveToPose follows odometry, so the routine assumes the drivetrain's pose has been seeded to the real starting pose before auto runs (e.g. from a known start position or a vision estimate). If odometry is wrong at the start, every leg is off by the same amount.

NOTE · API STATUS

This is the WPILib 2027 alpha

The code on this page targets the WPILib 2027 alpha stack — Commands v3 + OpModes (GradleRIO 2027.0.0-alpha-6, Phoenix 6 26.50.0-alpha-1) on Java 25 and SystemCore — so exact APIs may still shift between alpha builds. This page was last verified against alpha-6 in July 2026.
CHECKPOINT · 5 ITEMS

What's Next?

Up Next: Swerve Calibration

Accurate autonomous depends on accurate odometry. Next you'll calibrate your swerve drive (tune motor gains, configure slip-current limits, and measure wheel radius) so DriveToPose tracks your field poses precisely.