Lesson 41: Path Planning and Trajectories
Path planning is autonomous driving with a map. Instead of only saying "drive forward for two seconds," a path describes where the robot should be on the field over time.
Field Coordinates
Path planning uses a coordinate system. The robot has a pose: x position, y position, and heading. If the starting pose is wrong, the path follower starts with a bad assumption.
Trajectories
A trajectory is a path with timing. It describes not only where the robot should go, but how fast it should move along the way.
Why Odometry Matters
The robot needs to know where it thinks it is while following the path. Encoders and gyro readings update odometry. Slipping wheels, bad gyro resets, or incorrect wheel measurements will make the robot drift away from the planned path.
Path Tools
WPILib documents path planning tools and trajectory concepts. Teams may also use third-party tools depending on the season and robot. Treat the tool as a helper, not magic: the robot still needs correct measurements, tuned control, and safe testing.
Testing Paths
- Start slow.
- Verify the robot's starting pose.
- Test one path at a time.
- Keep a quick way to stop the robot.
- Log pose and target values while testing.
Practice
Draw a path from the starting line to a scoring location. Mark the starting pose, ending pose, and one obstacle the robot must avoid.