# Perception Model

This article focus on the following calculation in the Bayes Filter algorithm:

$$
p(z\_t|x\_t)
$$

which is the probability of obtaining the measurement $$z\_t$$ given the current robot state $$x\_t$$. For robots are often operating in a given environment,  a map is avaialble in many applications. In such cases, we can have an additional term in the formula as follows:

$$
p(z\_t|x\_t, m)
$$

where $$m$$ represents the information of the map.

In this article, we will present a couple of perception models:

* correlation-based measurement models
* likelihood fields model for range finders
* feature based models
* beam model

Disclaimer: The content of this article is based on the chapter 6 in the book Probabilistic Robotics.

You may notice that we rearrange the order of different models. The reason is that it may be easier to follow if we start with simple models.

One thing to notice is that the first three models use the map information directly, while the beam model extracts the map information by learning from the data.

## Correlation-Based Measurement Models

Correlation-Based measurement model is essentially a pattern matching algorithm. Given a robot state (note that this is not the current state of the robot. Instead, it's any possible state) and the sensor data, the algorithm performs the following steps

* construct a local map $$M\_{local}^{local frame}$$ based on the sensor data.
* use the provided robot state, we can map the local map data to the global map. (denoted by $$M\_{local}^{global frame}$$)
* calculate a similarity score between the constructed map (i.e. $$M\_{local}^{global frame}$$) and the real map

In the correlation-based measure model, we use correlation as the similarity measure. The correlation is then bounded away from zero. The obtains positive values is interpreted as the probability of the measurement. This interpretation is actually one of the drawbacks of correlation-based measurement models because there is no corresponding physical meaning.

Here we provide examples to visualize the idea. Suppose we have a global map and the robot collects some data  which is used to construct a local map:

<figure><img src="/files/ZMDHVdxCwoJDDXUcizmU" alt="" width="375"><figcaption></figcaption></figure>

Now we ask the question: given the local map, where do you think is the robot?

To an human eye, this is not a hard question. It's reasonable to make the following guesses:

<figure><img src="/files/XfWbuY2ZBcKXcpo7iWZX" alt="" width="375"><figcaption></figcaption></figure>

So why these spots? In fact, given a pose $$(x, y, \theta)$$ of the robot, we can project the collected sensor data to the global map and if the "pattern matches", then we know the pose $$(x, y, \theta)$$ is likely to be the actual pose of the robot.

<figure><img src="/files/eIqa4r6YWIXfAn6kqLpO" alt=""><figcaption></figcaption></figure>

The "pattern matching" has two parts: (1) pattern and (2) matching. For pattern part roughly corresponds to the transformation from local map to global map in the correlation-based models and the matching part is the calculation of similarity.

## Likelihood Fields for Range Finders

TODO

## Beam Models of Range Finders

Prerequisite: [EM Algorithm](/review-of-mathematics/probability/expectation-maximization-algorithm.md)&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.learnros2.com/probabilistic-robotics/perception-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
