Variable Naming Convention
$x_t$: state
$z_t$: measurement
$u_t$: control action
Mean Calculation
$\mu$: Mean of the prior belief
$\sigma^{2}$: Variance of the prior belief
$\nu$: Mean of the measurement
$r^{2}$: Variance of the measurement
Measurement update Formulas
The new mean is calculated as a weighted sum of the prior belief and measurement means.
$$\mu'=\frac{r^2\mu+\sigma^2\nu}{r^2+\sigma^2}$$
The new variance can be calculated as:
$$\sigma'^2=\frac{1}{\frac{1}{r^2}+\frac{1}{\sigma^2}}$$
This is implemented as measurement_update function in the code.
State Prediction Formulae
The state prediction is simply the sum of the means and variances to produce a new state prediction and variance respectively.
Posterior Mean: $$\mu'=\mu +\nu$$
Posterior Variance: $$\sigma'^2=\sigma^2_1 + \sigma^2_2$$
This is implemented as state_prediction function in the code.
This write was a part of Udacity’s Robotics Nano-Degree. The C++ code for this can be found here.