Autonomous: Driving to a Pose
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.
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
In the OpMode model there is no SendableChooser. 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"), put a mechanism command into the sequence or fork it inside a coroutine body.
🧩 Mixing in mechanism actions (the old "event markers")
Because legs are just commands, you can interleave superstructure actions with drive legs. Run the flywheel spin-up while driving, then score:
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.
What's Next?
Up Next: Swerve Calibration
DriveToPose tracks your field poses precisely.