Following a trajectory · University · about 50 min
A full route through waypoints, marked on how closely it was followed and how long it took.
[1 mark]What does this print for the project's route?
import math
PATH = [(30.0, 30.0), (30.0, 150.0), (120.0, 150.0), (120.0, 60.0), (170.0, 60.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(cum)
print(round(cum[-1] / 13.0, 1))[1 mark]The speed rule is cruise x max(0.45, 1 - off / 14) with a cruise of 13 cm/s. What speed does it give when the robot is 10 cm off the path, in cm/s to 2 decimal places?
[1 mark]Why is slowing down when off the path self correcting?
[1 mark]off path is small on the straights but spikes at every corner, and the robot clips the crate. Where should you look?
[1 mark]A follower that points its velocity at the look-ahead point stays within 1.3 cm of this route at L = 3. A classmate's robot turns to face the look-ahead point and drives forwards only, and it weaves along the straights. What is the likely cause?
[1 mark]The corner rule reduces speed in proportion to the angle between the path direction at the projection and at the look-ahead point. What idea is that?
Follow the tape from (30, 30) round to the green finish, within 10 cm of it for at least 85 percent of the run, without touching the crate, inside 90 seconds. Plot off path and speed, and print drove:, how far the robot actually travelled.
from bugbot import * import math connect() DT = 0.1 START = (30.0, 30.0) PATH = [(30.0, 30.0), (30.0, 150.0), (120.0, 150.0), (120.0, 60.0), (170.0, 60.0)] CRUISE, LOOK = 13.0, 16.0
Plan your program here, then type it in and press Run.
off path value.