Skip to content

l-winston/SLAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SLAM

SLAM (Simultaneous Localization And Mapping) is the process of creating a map of an environment while tracking the agent's location within it.

SLAM is a framework for temporal modeling of states that is commonly used in autonomous navigation. It is heavily based on principles of probability, making inferences on posterior and prior probability distributions of states and measurements and the relationship between the two. [1]

Step 1: Prediction

We estimate our current position with a motion model by using previous positions, the current control input, and noise.

Step 2: Measurement

Then, in the measurement step, we correct our prediction by using data from our sensors.

Proprioceptive sensors measure internal values - like acceleration, motor speeds, battery voltage, etc. For this project, I'll be simulating an inertial measurement unit by taking discrete measurement of artificially noisy (possibly systematic noise) linear and angular acceleration data.

Exteroceptive sensors collect data about the robot's environment, like distances to objects, light, sound, etc. For this project, I'll be simulating a collection of distance sensors by casting rays out from a "sensor" and recording the distances they travel.

Kalman Filters

Kalman Filters are a way for us to estimate the (unknown) actual state of an system (our agent's position and orientation) through the collection of noisy data.

We can give more weight to data that we know is more accurate by increasing the Kalman Gain associated with that measurement.

We take the state of a system and use a set of equations (ex. laws of physics) to extrapolate a predicted future state.

Notation Meaning
$x$ is the true value
$z_n$ is the measurement value of the weight at time $n$
$\hat{x}_{n, n}$ is the estimate of $x$ at time $n$ (the estimate is made after taking the measurement $z_n$)
$\hat{x}_{n, n-1}$ is the previous estimate of $x$ that was made at time $n-1$ (the estimate was made after taking the measurement $z_{n-1}$)
$\hat{x}_{n+1, n}$ is the estimate of the future state ($n+1$) of $x$. The estimate is made at the time $n$, right after the measurement $z_n$. In other words, $x_{n, n+1}$ is a predicted state

The Five Kalman Filter Equations:

State Update Equation:

$$
\hat{x}_{n, n} = \hat{x}_{n, n-1} + K_n (z_n - \hat{x}_{n, n-1})
$$

State Extrapolation Equations:

$$
\hat{x}_{n+1, n} = \hat{x}_{n, n} + \Delta t \hat{ \dot{x} }_{n, n}
$$

$$
\hat{\dot{x}}_{n+1, n} = \hat{\dot{x}}_{n, n}
$$

Kalman Gain Equation:

$$
K_n = \frac{p_{n, n-1}}{p_{n, n-1} + r_n}
$$

Covariance Update Equation

$$
p_{n, n} = (1-K_n)p_{n, n-1}
$$

Covariance Extrapolation Equation

$$
p_{n+1, n} = p_{n, n}
$$

Next, we take a measurement, tweak our estimation of the state, and then once again predict the future state.

Estimation Algorithm Flowchart

Sources & Resources

  1. How does Autonomous Driving Work? An Intro into SLAM
  2. Simultaneous Localization and Mapping
  3. MatLab: Understanding Kalman Filters
  4. https://www.kalmanfilter.net/default.aspx

About

SLAM (Simultaneous Localization And Mapping) is the problem of creating a map of an environment while tracking the agent's location within it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages