Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AE_SLAM

This repository is a compact SLAM study project for a differential-drive robot. It implements and compares two classical approaches to Simultaneous Localization and Mapping (SLAM):

  • EKF-SLAM: a single Gaussian estimate for robot pose and landmarks.
  • FastSLAM: a particle-based estimate for robot pose with per-landmark Gaussian filters.

The project is designed as a small simulation application: you can run a scenario, watch the robot move, see landmarks being estimated in real time, and inspect the final metrics and plots.

The accompanying report, Report.pdf, explains the theoretical background, implementation choices, and experimental conclusions.

What this project does

The repository simulates a robot moving in a 2D world with point landmarks. During the simulation:

  1. The robot follows a commanded trajectory.
  2. Wheel encoder noise corrupts odometry.
  3. A range-bearing sensor observes nearby landmarks.
  4. A SLAM algorithm estimates:
    • the robot trajectory,
    • the landmark map,
    • and uncertainty over time.

The main goal is to compare how EKF-SLAM and FastSLAM behave under noisy sensing, imperfect motion, nonlinear motion patterns, and uncertain data association.

Main takeaways

Based on Report.pdf:

  • EKF-SLAM works well in simpler settings and can build accurate maps when data association remains reliable.
  • FastSLAM 2.0 is generally more robust in nonlinear and noisy scenarios.
  • The most fragile part of the SLAM pipeline is data association.
  • Loop closure is especially important for EKF-SLAM.
  • Both approaches can degrade in hard scenarios with high noise and ambiguous landmark observations.

Repository structure

1. Simulation layer

The Simulation package contains the synthetic environment and sensor models shared by both algorithms.

2. EKF-SLAM

The EKF_SLAM package implements a classical Extended Kalman Filter SLAM pipeline.

  • EKF_SLAM/EKF_SLAM.py: core EKF-SLAM class.
    • state prediction from odometry,
    • measurement model and Jacobians,
    • nearest-neighbor style data association,
    • candidate landmark management,
    • landmark insertion into the state vector,
    • batch Joseph-form style covariance update.
  • EKF_SLAM/main.py: runnable experiment script for EKF-SLAM.
    • builds the world,
    • runs the simulation loop,
    • computes metrics such as RMSE and OSPA,
    • shows online and final plots.

3. FastSLAM

The FastSLAM package contains two particle-based variants.

How the application flows

No matter which algorithm you run, the flow is roughly the same:

  1. Generate a world with landmarks.
  2. Initialize the robot and sensor.
  3. Initialize the chosen SLAM estimator.
  4. Repeatedly:
    • move the robot,
    • generate noisy observations,
    • predict the new state,
    • associate observations with landmarks,
    • update the map and robot estimate,
    • visualize progress.
  5. Print final statistics and show summary plots.

Implemented metrics

The project evaluates performance with:

  • Trajectory RMSE: average pose error along the path.
  • OSPA: a metric that evaluates both localization quality and landmark set mismatch.
  • Landmark matching statistics: number found, missed, and false positives.
  • Uncertainty traces: estimator confidence over time.

These are implemented directly in the runnable scripts, mainly in EKF_SLAM/main.py and FastSLAM/main_1.py.

Requirements

The code imports only a small scientific Python stack:

  • numpy
  • scipy
  • matplotlib

A recent Python 3 version should be sufficient.

Quick start

From the repository root, run one of the following:

  • python EKF_SLAM/main.py
  • python FastSLAM/main_1.py
  • python FastSLAM/main_2.py

Each script opens Matplotlib windows for online visualization and prints final performance statistics in the terminal.

Which script should I open first?

If you are new to the repository, this is the easiest reading order:

  1. Report.pdf for motivation and conclusions.
  2. Simulation/World.py, Simulation/Robot.py, and Simulation/Sensor.py to understand the simulated environment.
  3. EKF_SLAM/main.py or FastSLAM/main_1.py to see the full experiment loop.
  4. Then open the algorithm core:

Differences between the two approaches

EKF-SLAM

Best when you want:

  • a compact single-state estimator,
  • explicit covariance tracking,
  • a more classical probabilistic robotics baseline.

Trade-offs:

  • sensitive to wrong data association,
  • depends on linearization,
  • scales less gracefully as the map grows.

FastSLAM

Best when you want:

  • stronger robustness in nonlinear settings,
  • multiple pose hypotheses through particles,
  • better behavior under harder observation conditions.

Trade-offs:

  • more computationally expensive,
  • more parameters to tune,
  • map quality still depends heavily on reliable association.

Notes about the current codebase

  • The repository is focused on simulation, not real robot deployment.
  • Landmark observations are anonymous: the algorithms must manage association uncertainty.
  • Visualization is an important part of the project; most scripts are meant to be run interactively.
  • The code is research/project oriented rather than packaged as a library.

If you want to extend it

Good next improvements would be:

  • stronger data association, such as JCBB,
  • configuration files for experiment presets,
  • command-line arguments for choosing scenario and noise levels,
  • saving plots automatically,
  • reproducible benchmark datasets.

Summary

In short, this repository is a teaching/research project that compares EKF-SLAM and FastSLAM 2.0 in a controlled 2D simulation. If you want to understand the project quickly, start with Report.pdf, then run EKF_SLAM/main.py and FastSLAM/main_1.py to see both estimators in action.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages