Following a trajectory · University · about 35 min
Chase a point a fixed distance ahead on the path, and choose the one number that decides everything.
[1 mark]A car chases a look-ahead point 18 cm ahead that is 3 cm to the side in the body frame. What radius of arc does pure pursuit command, in cm?
[1 mark]What does a longer look-ahead distance cost?
[1 mark]The BugBot follows a circle of radius 40 cm with pure pursuit, pointing its velocity at a look-ahead point L = 18 cm further along. By roughly how much does it track inside the circle, in cm to 1 decimal place?
[1 mark]A robot that steers like a car, turning to face the look-ahead point and driving forwards, weaves down a straight line with a period of about 2 s. What is the fix?
[1 mark]At L = 3 and 14 cm/s a follower that steers like a car weaves up to 4.1 cm either side of the tape, but the task's follower, which points its velocity at the look-ahead point, stays within 0.5 cm. Why?
[1 mark]Why is projecting onto the path and adding L better than intersecting a circle of radius L with the path?
[1 mark]The lesson's path is built from a straight, a quarter circle as 8 chords, and a straight. What does this print?
import math
arc = [(80 + 40 * math.cos(math.radians(180 - k * 11.25)),
120 + 40 * math.sin(math.radians(180 - k * 11.25))) for k in range(9)]
PATH = [(40.0, 40.0)] + arc + [(150.0, 160.0)]
cum = [0.0]
for (ax, ay), (bx, by) in zip(PATH, PATH[1:]):
cum.append(cum[-1] + math.hypot(bx - ax, by - ay))
print(round(cum[-1], 1), round(80 + 20 * math.pi + 70, 1))[1 mark]Why is the look-ahead usually made to grow with speed, L = L0 + k v?
The tape runs straight from (40, 40) to (40, 120), round a quarter circle of radius 40 centred on (80, 120), then straight to (150, 160). Follow it with pure pursuit, plot off path and speed, print path: (the length of the path) and drove: (how far the robot actually travelled), and stop at the far end.
from bugbot import * import math connect() DT = 0.1 START = (40.0, 40.0) CRUISE, LOOK = 11.0, 18.0
Plan your program here, then type it in and press Run.
LOOK = 6 and at LOOK = 45. Which one cuts the corner, and by how much? Does the short one weave at all?v * 2 * sin(alpha) / L radians a second, where alpha is the angle of the look-ahead point from the way the robot faces. Run L = 3 at 14 cm/s and watch the first straight, then try L = 5.off path value in the corner and compare it with L * L / (2 * 40).