This repository contains interactive Jupyter notebooks that introduce the fundamentals of Simultaneous Localization and Mapping (SLAM). The notebooks provide a step-by-step look at Bayes Filter, Kalman Filters, Particle Filters, and Graph-based methods, combining theoretical explanations with Python code.
The material is structured as a three-lecture mini-course. It only covers a small portion of the rich SLAM literature and is intended as a beginner-friendly introduction.
Example in pygame: Raw Motion and Observation Models vs. EKF-SLAM vs. MCL vs. Grid-FastSLAM
You can run the notebooks in different environments depending on your preference.
-
Clone the repository:
git clone https://github.com/nstathou/hello-slam.git cd hello-slam -
(Recommended) Create and activate a virtual environment:
python -m venv .hello_slam # Linux source .hello_slam/bin/activate # Windows (PowerShell) .hello_slam\Scripts\Activate.ps1
-
Install dependencies:
pip install -r requirements.txt
-
Open the folder in Visual Studio Code.
-
Install the Python and Jupyter extensions.
-
Open any
.ipynbfile, select a Python kernel, and run cells.
-
-
Clone the repository (same as above).
-
(Optional) Create and activate a virtual environment (same as above).
-
Install dependencies (same as above).
-
Install Jupyter:
pip install jupyter-core
-
Go into the folder and launch JupyterLab:
cd hello-slam jupyter lab -
Open any notebook
(.ipynb)and run the cells.
-
Download this repository as a .zip file from GitHub and extract it locally.
-
Go to Google Colab.
-
Upload the notebook
(.ipynb)files you want to run. -
If the notebook needs extra packages, install them at the top of the notebook, for example:
!pip install numpy matplotlib scipy
The course is organized into modules:
0_intro.ipynb– An overview of what is SLAM.
1_bayes.ipynb– Bayes filters and recursive state estimation.2_models.ipynb– Motion and sensor models.3_kalman_filters.ipynb– Kalman & Extended Kalman filters.4_ekf_slam.ipynb– EKF-SLAM implementation.
1_grid_maps.ipynb– Occupancy grid mapping.2_particle_filter.ipynb– Monte Carlo localization.3_fast_slam.ipynb– FastSLAM.4_grid_based_slam.ipynb– Rao-Blackwellized particle filter for SLAM.
1_least_squares.ipynb– Nonlinear least-squares estimation.2_least_squares_slam.ipynb– Least-squares formulation of SLAM.3_landmark_graph_slam.ipynb– Landmark Graph-based SLAM.
This material is heavily inspired by the SLAM Course by Prof. Cyrill Stachniss and the Probabilistic Robotics book by Sebastian Thrun, Wolfram Burgard, and Dieter Fox.
For additional references and suggested literature, please check the 0_intro.ipynb notebook.
For questions, feedback, or collaboration, feel free to reach out at niksta@ltu.se



