The Math For It

Draw a Circle With the Robot as the center

\( (x - h)^2 + (y - k)^2 = r^2 \)

This equation represents a circle where:

  • \( (h, k) \) is the center of the circle and the robot.
  • \( r \) is the "lookahead" distance, which is how far ahead on the path we want to look ahead. This is also the radius of the circle. A smaller lookahead distance makes the robot more reactive, while a larger lookahead distance makes it more stable but less responsive to path changes.
  • \( (x, y) \) represents any point on the circle we draw around our robot.

Going to the point

  • We then want to use a control algorithim such as Pid to head towards the point of intersection with the Circle and the path.
  • Algorithm Steps

    The Pure Pursuit algorithm follows these steps:

    1. Draw a circle around the robot with your chosen lookahead-value(Bigger lookahead means it will follow the path less close and smaller means it will follow the path more close).
    2. See on the path where the circle intersects.
    3. Use a error-based control algorithim such as PID, to make the robot head towards that point.
    4. Adjust the robot’s movement accordingly.
    5. Repeat the process at each timestep until you reach your end point(Note if the circle goes past the ending point just set the next point to head to as the ending point).