Planning · University · about 35 min
The goal pulls, the obstacles push, and the robot slides downhill into a local minimum.
[1 mark]What does this program print?
K, REACH, CAP = 120000.0, 45.0, 60.0
for d in (10.0, 30.0, 50.0):
m = 0.0
if d < REACH:
m = min(CAP, K * (1.0 / d - 1.0 / REACH) / (d * d))
print(d, round(m, 2))
[1 mark]What does this program print?
import math
ox, oy, ow, oh = 80.0, 10.0, 30.0, 90.0
for x, y in ((60.0, 40.0), (120.0, 120.0)):
nx, ny = min(max(x, ox), ox + ow), min(max(y, oy), oy + oh)
print((nx, ny), round(math.hypot(x - nx, y - ny), 2))
[1 mark]Why can a local minimum in a potential field not be tuned away?
[1 mark]Which of these situations commonly trap a potential field controller?
Tick every answer that is true.
[1 mark]What do modern navigation stacks do with potential fields?
[1 mark]Why does the attraction have a FLOOR rather than easing smoothly all the way to zero?
[1 mark]Why does the repulsion use the factor (1/d - 1/d0) rather than just 1/d?
Drive to the green corner at (170, 160) using a potential field and nothing else: no route, no grid, just a velocity worked out fresh each tick from the pull and the push. Plot pull and push, the size of each part, and do not touch the block or the mat edges.
from bugbot import * import math connect() DT = 0.1 V_MAX, V_LAT = 20.0, 15.0 START = (30.0, 40.0) GOAL = (170.0, 160.0) BLOCK = (80.0, 10.0, 30.0, 90.0)
Plan your program here, then type it in and press Run.