Mapping · University · about 35 min
Eight beams, a known pose, and a map that fills in while the robot drives.
[1 mark]What does this program print?
W = 40 row, col = 3, 7 i = row * W + col print(i) print(divmod(1234, W))
[1 mark]The robot drives at 30 cm/s and the mapper uses the pose from 150 ms after the scan was taken. How far, in cm, is every wall smeared?
[1 mark]Every wall in a map comes out shifted and some land off the edge of the grid, but their shapes are right. What is the most likely bug?
[1 mark]Put the steps of integrating one tick of scans into the grid in order.
Number the lines 1 to 5 to put them in the right order.
If the range is a real return, add L_OCC at the hit cellAdd L_FREE once to each cell in the setStep along the beam in half cells to one cell short of the range, collecting the cells in a setFor each beam, work out th = radians(heading + beam angle)Fetch the pose and add the start position[1 mark]The plot of the known fraction has gone flat while the robot keeps driving in the same direction. What does that tell you?
[1 mark]Why is it normal to require several occupied cells in a row before believing a wall is there?
The robot starts at (100, 40). Drive at least 40 cm up the mat, integrating every scan into a log odds grid. Plot known, then print known:, the fraction of the grid your map has an opinion about, and wall y:, where your map puts the near face of the wall.
from bugbot import * import math connect() CELL, W = 5.0, 40 L_OCC, L_FREE, L_MAX, FAR = 0.85, -0.4, 8.0, 170.0 START_X, START_Y = 100.0, 40.0 grid = [0.0] * (W * W)
Plan your program here, then type it in and press Run.