For today's class, you'll need the following tools/applications ready and running:
Here, we detail a beam model for range finders algorithm.
\(\textrm{Algorithm beam_range_finder_model}(z_t, x_t, m):\)
\( \qquad q = 1 \)
\( \qquad \textrm{for} \: k = 1 \: \textrm{to} \: K \: \textrm{do} \)
\( \qquad\qquad \textrm{compute} \: z_t^{k*} \: \textrm{for the measurement} \: z_t^{k} \: \textrm{using ray casting} \)
\( \qquad\qquad p = z_{hit} \cdot p_{hit}(z_t^k|x_t,m) + z_{short} \cdot p_{short}(z_t^k|x_t,m) + z_{max} \cdot p_{max}(z_t^k|x_t,m) + z_{rand} \cdot p_{rand}(z_t^k|x_t,m) \)
\( \qquad\qquad q = q \cdot p\)
\( \qquad \textrm{return} \: q \)
Here, we provide additional details on the algorithm above:
The beam model of range finders accounts for 4 types of possible measurement error: measurement noise, unexpected objects, failure to detect obstacles, and random measurements.
Measurement noise is accounted for through \( p_{hit}(z_t^k | x_t, m) \) according to: $$p_{hit}(z_t^k | x_t, m) = \{ \: \eta \mathcal{N}(z_t^k;z_t^{k*},\sigma_{hit}^2), \:\: \textrm{if} \: 0 \le z_t^k \le z_{max} \: ; \: 0, \: \textrm{otherwise} \}$$ where \(\mathcal{N}(z_t^k;z_t^k*,\sigma_{hit}^2)\) denotes the univariate normal distribution with mean \(z_t^{k*}\) and standard deviation \(\sigma_{hit}\), and \(\eta\) is a normalizing constant.
Unexpected objects (e.g., a person walking through the space that isn't captured in our static map) is accounted for through \( p_{short}(z_t^k | x_t, m)\) according to: $$p_{short}(z_t^k | x_t, m) = \{ \: \eta \lambda_{short} e^{-\lambda_{short}z_t^k}, \:\: \textrm{if} \: 0 \le z_t^k \le z_t^{k*} \: ; \: 0, \: \textrm{otherwise} \} $$ where \(\lambda_{short}\) is an intrinsic parameter of the measurement model, and \(\eta\) is a normalizing constant.
We account for a possible failure to detect obstacles assuming that failures result in a max-range measurement (due to, for example, sensing black light-absorbing objects or measuring objects in bright sunlights) according to: $$p_{max}(z_t^k | x_t, m) = \{ \: 1 \: \textrm{if} \: z = z_{max}, \: 0 \: \textrm{otherwise} \: \}$$
Finally, we account for random measurements according to: $$p_{rand}(z_t^k | x_t, m) = \{ \: \frac{1}{z_{max}} \textrm{if} \: 0 \le z_t^k \le z_{max}, \: 0 \: \textrm{otherwise} \: \}$$
Here, we detail a likelihood field for range finders algorithm.
\( \textrm{Algorithm likelihood_field_range_finder_model}(z_t, x_t, m): \)
\( \qquad q = 1 \)
\( \qquad \textrm{for} \: k = 1 \: \textrm{to} \: K \: \textrm{do} \)
\( \qquad \qquad \textrm{if} \: z_t^k \ne z_{max} \)
\( \qquad \qquad \qquad x_{z_t^k} = x + x_{k,sens} cos \theta - y_{k,sens} sin \theta + z_t^k cos \big( \theta + \theta_{k,sens} \big) \)
\( \qquad \qquad \qquad y_{z_t^k} = y + y_{k,sens} cos \theta - x_{k,sens} sin \theta + z_t^k sin \big( \theta + \theta_{k,sens} \big) \)
\( \qquad \qquad \qquad dist = \textrm{min}_{x', y'} \: \Big\{ \sqrt{(x_{z_t^k} - x')^2 + (y_{z_t^k} - y')^2} \Big| \langle x', y' \rangle \: \textrm{occupied in } m \Big\} \)
\( \qquad \qquad \qquad q = q \cdot \bigg( z_{hit} \: \textrm{prob}(dist,\sigma_{hit}) + \frac{z_{random}}{z_{max}} \bigg) \)
\( \qquad \textrm{return} \: q \)
Here, we provide additional details on the algorithm above:
We are going to repeat the exercise from Class Meeting 04, but instead of completing the measurement model using a ray casting approach, we'll use a likelihood field approach.
We'll use the same 2D grid world that we did before (pictured below on the left) as well as the likelihood field for this grid world (pictured below on the right).
Again, our particles are located at the following positions represented as [x, y, Θ]:
We represent sensor measurement \(z_t\) as an array of 3 values representing the left, front, and sensor measurements in that order. For example, if our robot were at the location and direction [1.0, 2.0, 90°], our robot's sensor readings would be \(z_t = \) [1.0, 3.0, 1.0].
In order to determine which of these guesses corresponds with our robot's true location in the 2D world, we will again iterate through the following process:
For each of the following time steps (with its corresponding robot movements and sensor readings), go through the three steps above to execute this simplified version of a particle filter to localize the robot:
Once you finish calculating going through the move, compute weights, and resample steps for each of the three timesteps you can check your solutions on this Likelihood Field exercise solutions page.
This page and the content for today's lecture were informed by Probabilistic Robotics by Sebastian Thrun, Wolfram Burgard, and Dieter Fox.