The answersDownload the PDF
Worksheet

U9.5 Potential fields

Planning · University · about 35 min

BugBotLab
NameClassDate

What this lesson is about

The goal pulls, the obstacles push, and the robot slides downhill into a local minimum.

Questions 7 marks in all

  1. [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))
    
  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))
    
  3. [1 mark]Why can a local minimum in a potential field not be tuned away?

    1. AIt comes from adding the fields together, and a method that only sees the gradient where it stands cannot be complete
    2. BIt is caused by rounding in the arithmetic, which smaller time steps would fix
    3. CIt only happens when the repulsion constant is too large
    4. DIt only happens when the goal is inside the reach of an obstacle
  4. [1 mark]Which of these situations commonly trap a potential field controller?

    Tick every answer that is true.

    1. AA wall square across the line to the goal
    2. BA U shaped obstacle opening towards the robot
    3. CTwo obstacles with a gap between them
    4. DA single block with the goal up and to one side of it
  5. [1 mark]What do modern navigation stacks do with potential fields?

    1. AUse a field or similar reactive method as a local layer following a route from a global planner such as A*
    2. BUse them as the only planner, with random walks when they stall
    3. CNothing: they have been abandoned entirely
    4. DUse them to build the occupancy grid
  6. [1 mark]Why does the attraction have a FLOOR rather than easing smoothly all the way to zero?

    1. ABelow about 15 percent of full command the motors do not turn, so a pull that fades to zero leaves the robot parked short of the goal
    2. BWithout it the robot orbits the goal
    3. CIt prevents the repulsion from blowing up near a wall
    4. DIt makes the field free of local minima
  7. [1 mark]Why does the repulsion use the factor (1/d - 1/d0) rather than just 1/d?

    1. AIt falls smoothly to zero at the edge of the reach d0, instead of switching off with a jolt
    2. BIt stops the push blowing up close to the obstacle
    3. CIt makes the push point towards the goal
    4. DIt makes the field a navigation function

The task: slide round the block

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.

QR code
Do it on the robot
www.bugbotlab.com/learn/u9-5-potential-fields/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Move the goal to (170, 40), directly behind the block, and run the same program. Describe precisely what the robot does and why.
  2. Add stall detection: if the robot has moved less than 2 cm in two seconds and is not at the goal, drive in a random direction for a second. Does it escape the case above reliably?
  3. Put a second block 40 cm from the first and try to drive between them. At what separation does the gap close?