cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.03k stars 2.24k forks source link

Hit and miss probabilities #1874

Closed kawanchris closed 2 years ago

kawanchris commented 2 years ago

I am a beginner with Google Cartographer and try to understand the mathematics behind the code. One thing that is not clear to me is the precise meaning of the probabilities p{hit} and p{miss} (are these actually probabilities or rather odds?). I am referring now to the paper

W. Hess, D. Kohler, H. Rapp, and D. Andor, Real-Time Loop Closure in 2D LIDAR SLAM, in Robotics and Automation (ICRA), 2016 IEEE International Conference on. IEEE, 2016. pp. 1271–1278.

According to the formula for updating the values in the probability grid, we have (ignoring the clamp)

M{new}(x) = odds^{-1}(odds(M{old}(x)) odds(p{hit})) = ( M{old}(x) p{hit} ) / ( M{old}(x)p{hit} + (1 - M{old}(x)) (1 - p_{hit})).

This reminds me of a probability update using the Bayes rule. If M{new}(x) is the probability that the point x is obstructed given that the sensor tells me so (i.e. P(obstructed|hit) ) and p{hit} is the probability of a correct sensor detection of an obstructed point (i.e. P(hit|obstructed)), I obtain by the Bayes rule (and the law of total probability):

M{new}(x) = ( p{hit} M{old}(x) ) / ( p{hit} M{old}(x) + P(hit|not obstructed) (1 - M{old}(x)) ).

This, however, is not exactly the formula above, since P(hit|not obstructed) is not 1 - p_{hit} = 1 - P(hit|obstructed).

Can someone help me figure this out?