Algorithm Search⌘K

Modelcore

Inverse sensor model

Also called inverse measurement model.

The probability that a map cell is occupied given one sensor reading and the pose, used by occupancy grid mapping.

An inverse sensor model gives, for one cell of a map, the probability that the cell is occupied, given one sensor reading and the pose of the robot. It runs in the opposite direction of the usual measurement model. A forward model such as the beam range finder model says which readings to expect from a known world; the inverse model says what one reading tells about the world. For a range sensor the rule is simple: cells that the beam passed through are probably free, cells near the end of the beam are probably occupied, and the reading tells nothing about the other cells. Occupancy grid mapping adds the log odds of this probability to each cell of an occupancy grid map. The model treats each cell on its own, which is an approximation. The notation is the one of Thrun, Burgard and Fox (2005).

The machine

State. The pose xt=(x,y,θ)x_t = (x, y, \theta) of the robot, known, and a map of cells m1,…,mgm_1, \ldots, m_g, each occupied (mi=1m_i = 1) or free (mi=0m_i = 0). Cell ii has its center at (xi,yi)(x_i, y_i).

Measurement. A scan ztz_t of KK beams; beam kk has a bearing θk\theta_k in the robot frame and a reading ztk≤zmax⁡z_t^k \le z_{\max}.

Output. For each cell, p(mi=1∣zt,xt)p(m_i = 1 \mid z_t, x_t), usually in log odds logit⁡p=log⁡(p/(1−p))\operatorname{logit} p = \log(p / (1 - p)). The prior is p(mi=1)p(m_i = 1) with log odds l0l_0.

The range sensor rule. Thrun, Burgard and Fox (2005) give this inverse model for range finders. For cell ii, let rr be its distance from the robot, ϕ=atan2⁡(yi−y,xi−x)−θ\phi = \operatorname{atan2}(y_i - y, x_i - x) - \theta its bearing, and kk the beam whose bearing θk\theta_k is closest to ϕ\phi. Then the log odds is

  • l0l_0 if r>min⁡(zmax⁡, ztk+α/2)r > \min(z_{\max},\ z_t^k + \alpha/2) or ∣ϕ−θk∣>β/2|\phi - \theta_k| > \beta/2: the cell lies beyond the reading or outside every beam;
  • loccl_{\mathrm{occ}} if ztk<zmax⁡z_t^k < z_{\max} and ∣r−ztk∣<α/2|r - z_t^k| < \alpha/2: the cell is at the end of a beam that hit something;
  • lfreel_{\mathrm{free}} if r≤ztkr \le z_t^k: the beam passed through the cell.

The three tests are applied in this order. A reading at zmax⁡z_{\max} marks no cell as occupied, because a max range reading means that the beam hit nothing.

Parameters. α\alpha is the assumed thickness of obstacles in meters, β\beta the width of a beam in radians, and loccl_{\mathrm{occ}} and lfreel_{\mathrm{free}} the log odds for a hit and a pass. A common choice is the log odds of 0.7 and 0.4, locc=log⁡(0.7/0.3)≈0.84730l_{\mathrm{occ}} = \log(0.7/0.3) \approx 0.84730 and lfree=log⁡(0.4/0.6)≈−0.40547l_{\mathrm{free}} = \log(0.4/0.6) \approx -0.40547. These values are rules of thumb, not derived from the sensor. OctoMap uses the rounded values 0.85 and -0.4 in log odds (see octree occupancy map).

Standing assumptions. The pose is known. Each cell is judged on its own, given the reading, as if the cells were independent; this is an approximation. Readings at different times are independent given the map.

Example. The robot is at (0,0,0)(0, 0, 0), one beam has bearing 0 and reading z=2z = 2 m, α=0.2\alpha = 0.2 m, zmax⁡=6z_{\max} = 6 m, and the prior is 0.5, so l0=0l_0 = 0. Cells with centers on the beam get:

distance rr of the cell (m) 1.00 1.95 2.05 2.15
log odds lfreel_{\mathrm{free}} loccl_{\mathrm{occ}} loccl_{\mathrm{occ}} l0l_0

The cell at 2.152.15 lies beyond z+α/2=2.1z + \alpha/2 = 2.1, so the reading says nothing about it. For a max range reading z=6z = 6, a cell at 5.955.95 gets lfreel_{\mathrm{free}} and a cell at 6.056.05 gets l0l_0. A cell at bearing 0.5 rad with β=0.1\beta = 0.1 is outside the beam and gets l0l_0.

What it counts

The model assigns to each cell its occupancy probability given one scan. With the rule above, one cell costs O(1)O(1) arithmetic plus the search for the nearest beam, which is O(1)O(1) when the bearings are evenly spaced and O(log⁡K)O(\log K) by binary search otherwise. Occupancy grid mapping evaluates it for the cells within zmax⁡z_{\max} of the robot, so one scan costs O(g)O(g) evaluations on a grid of gg cells in the worst case. Walking each beam through the grid with a line traversal instead visits O(K(1+zmax⁡/s))O(K (1 + z_{\max}/s)) cells for a cell side ss.

Relation to other models

  • Forward models. The beam range finder model gives p(zt∣xt,m)p(z_t \mid x_t, m) for a whole map. By Bayes' theorem, p(mi∣zt,xt)=∑m:mip(zt∣xt,m) p(m)/p(zt∣xt)p(m_i \mid z_t, x_t) = \sum_{m: m_i} p(z_t \mid x_t, m)\, p(m) / p(z_t \mid x_t), a sum over all maps with the given value of mim_i. So the inverse model of one cell is a marginal over all other cells, which no one computes exactly; the range sensor rule is a hand-made stand-in for it.
  • Occupancy grid mapping. The algorithm that uses this model, one binary Bayes filter per cell. Its page has an implementation of the range sensor rule with tests.
  • Octree occupancy map. Uses the same model in 3D, with the beam walked through voxels and with clamping of the log odds.
  • Classifiers. An inverse model is a classifier that predicts the label of a cell from the readings, so any probabilistic classifier, such as logistic regression, can serve as one if it is trained on labeled data.

Known results in the model

  • Theorem (the log odds update). Assume that ztz_t is independent of z1:t−1z_{1:t-1} given mim_i and the poses. Then lt,i=lt−1,i+logit⁡p(mi=1∣zt,xt)−l0l_{t,i} = l_{t-1,i} + \operatorname{logit} p(m_i = 1 \mid z_t, x_t) - l_0, where lt,il_{t,i} is the log odds of p(mi=1∣z1:t,x1:t)p(m_i = 1 \mid z_{1:t}, x_{1:t}). Proof: by Bayes' theorem and the assumption, p(mi∣z1:t)=p(zt∣mi) p(mi∣z1:t−1)/p(zt∣z1:t−1)p(m_i \mid z_{1:t}) = p(z_t \mid m_i)\, p(m_i \mid z_{1:t-1}) / p(z_t \mid z_{1:t-1}), and again by Bayes' theorem p(zt∣mi)=p(mi∣zt) p(zt)/p(mi)p(z_t \mid m_i) = p(m_i \mid z_t)\, p(z_t) / p(m_i). Divide the expression for mi=1m_i = 1 by the one for mi=0m_i = 0: the terms p(zt)p(z_t) and p(zt∣z1:t−1)p(z_t \mid z_{1:t-1}) cancel, and the log of the ratio is the sum above. The assumption is an approximation, since ztz_t also depends on the other cells.
  • Theorem (the order of readings does not matter). Without clamping, the log odds after TT readings is l0+∑t(logit⁡p(mi∣zt,xt)−l0)l_0 + \sum_t (\operatorname{logit} p(m_i \mid z_t, x_t) - l_0), a sum, so it does not depend on the order of the readings. With the values 0.7 and 0.4, one hit outweighs one pass by 0.84730/0.40547≈2.090.84730 / 0.40547 \approx 2.09, so a cell seen as occupied once and as free twice ends at log odds 0.03640.0364, probability about 0.5090.509.
  • Approximation (cells judged one by one). A wide beam, such as a sonar cone, says that some cell on the arc at range zz is occupied, not that every cell is. The inverse model gives each cell on the arc loccl_{\mathrm{occ}}, and readings from other places that pass through those cells push them back to free. With many conflicting readings the resulting map depends on the parameters more than on the data. Thrun, Burgard and Fox (2005) treat this in Section 9.4 by searching for the map of maximum posterior probability under the forward model, which keeps the dependence between cells.
  • Learning inverse models. Section 9.3 of the same book learns an inverse model from a forward model: draw maps from a prior, simulate readings with the forward model, and train a function approximator to predict the occupancy of a cell from the readings near it. This replaces the hand-made rule with a fitted one, at the cost of a training set and a choice of features.
  • Heuristic (the parameters). α\alpha, β\beta, loccl_{\mathrm{occ}} and lfreel_{\mathrm{free}} are set by hand or tuned on maps with known ground truth. Larger loccl_{\mathrm{occ}} makes the map react faster to new obstacles and also to noise; clamping the log odds, as OctoMap does, keeps the map able to change after many agreeing readings.

References

  1. Sebastian Thrun, Wolfram Burgard and Dieter Fox, Probabilistic Robotics, MIT Press, 2005, Chapter 9, Section 9.2 (the inverse range sensor model of Table 9.2 and its use in Table 9.1), Section 9.3 (learning inverse measurement models from forward models) and Section 9.4 (maximum a posteriori mapping with forward models)
  2. Hans P. Moravec and Alberto Elfes, High resolution maps from wide angle sonar, Proceedings of the 1985 IEEE International Conference on Robotics and Automation, volume 2, pages 116 to 121, the grid of cells with probabilities of empty and occupied space, built from many sonar cones
  3. Alberto Elfes, Using occupancy grids for mobile robot perception and navigation, Computer 22(6), 1989, pages 46 to 57, the sensor model and the Bayesian update of the cell states of an occupancy grid

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/0D5R7R/text.yaml