Mapping · University · about 30 min
Why the cells hold a log odds and not a probability, and what the clamp is for.
[1 mark]What does this program print?
import math p = 0.7 l = math.log(p / (1 - p)) print(round(l, 2)) print(round(1.0 / (1.0 + math.exp(-l)), 2))
[1 mark]What does this program print?
import math
L_OCC, L_FREE, L_MAX = 0.85, -0.4, 10.0
l = 0.0
for update in (L_OCC, L_OCC, L_FREE, L_OCC, L_FREE):
l = max(-L_MAX, min(L_MAX, l + update))
print(round(l, 2), round(1.0 / (1.0 + math.exp(-l)), 3))
[1 mark]Why do occupancy grids store log odds rather than probabilities?
[1 mark]Why is |L_OCC| larger than |L_FREE| in almost every implementation?
[1 mark]A mapper steps along each beam in half cells and adds L_FREE = -0.4 at every step. What is one beam passing through a cell really worth?
[1 mark]What is the main purpose of clamping each cell's log odds to plus or minus 10?
[1 mark]A cell starts unknown at log odds 0 and receives only hits of +0.85, with a clamp at 10. How many hits does it take to reach the clamp?
[1 mark]The function log(p / (1 - p)) has another standard name, the inverse of the logistic function. What is it?
Print p one:, the probability a cell is occupied after one hit starting from an empty map. Then take 25 readings, updating a grid in log odds with a clamp at 10 and each cell changed at most once per reading, and print wall l: and wall p: for the cell the wall is in.
from bugbot import * import math connect() CELL = 5.0 L_OCC, L_FREE, L_MAX = 0.85, -0.4, 10.0 X0, Y0 = 100.0, 50.0
Plan your program here, then type it in and press Run.
L_FREE to -0.85 as well, run the map in U8.4, and look at the row just in front of the wall. What changes, and what have you given up to get it?