Exercise - Sensorfusion and Localization (1D-Kalman Filter)

Introduction

[TODO]

Requirements

Knowledge

To complete this exercise notebook, you should possess knowledge about the following topics:

Kalman Filter 1D

  • Notes by Christian Herta [HER18]

Python Modules

import scipy.stats  
import numpy as np
from matplotlib import pyplot as plt

%matplotlib inline

Exercises

Exercise - Sensorfusion

We have three sensor which measure a distance.

We get the following values from the measurements:

  • Sensor 1: 50.150.1 cm
  • Sensor 2: 49.349.3 cm
  • Sensor 3: 49.749.7 cm

From the calibration of the sensors we have the following estimate of the standard deviations for the sensors (in the range 30-90 cm):

  • Standard deviation of sensor 1: 0.80.8 cm
  • Standard deviation of sensor 2: 1.21.2 cm
  • Standard deviation of sensor 3: 0.90.9 cm

Assume that the sensors are prefectly calibrated such we have no systematic error (bias).

Remark: If you are interesed how to estimate the error of an sensor, then read for an easy explaination https://amloceanographic.com/blog/sensor-accuracy/

Tasks:

  • What is the distance if we combine of all three measurements?

  • Also give an error estimate of the result (the true value should be in at least 0.95 of the Gaussian area), e.g. as 88±488\pm 4m (How is this related to the standard deviation?)

Solve the exercise

  1. with pen & paper
  2. implement it with numpy
  3. plot the differnet Gaussians.

Note: Take care for the significant digits you use.

sigma123 * 2

Exercise - 1D Kalman Filter

A robot moves with a velocity of about 33 m/s. We assume that if the robot moves in a time Δt=2\Delta t=2s we have an standard deviation of the moved distance of 0.80.8m.

Each 2 seconds we measure the position with an standard deviation σ\sigma of 1.21.2 m.

We get the following measurements:

  • z(t=0z(t=0s)=2) = -2m (inital σ=0\sigma=0)
  • z(t=2z(t=2s)=3.4) = 3.4 m
  • z(t=4z(t=4s)) = no measurement
  • z(t=6z(t=6s)=16.3)= 16.3 m

Task:

What is the predicted position before the measurement at t=8t=8s.

In the state space we use just the position of the robot (1D). Solve the exercise

  1. with pen & paper
  2. implement it with numpy

Literature

Licenses

Notebook License (CC-BY-SA 4.0)

The following license applies to the complete notebook, including code cells. It does however not apply to any referenced external media (e.g., images).

Exercises - Sensorfusion and Localization (1D-Kalman Filter)
by Christian Herta
is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Based on a work at https://gitlab.com/deep.TEACHING.

Code License (MIT)

The following license only applies to code cells of the notebook.

Copyright 2018 Christian Herta

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.