• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Robot Localization in Maze Using Particle Filter

Particle Filter

Lei Mao

University of Chicago

Introduction

Particle filter is a Monte Carlo algorithm used to solve statistical inference problems. In this project, the turtle location and heading direction in maze was infered using particle filter. The green turtle is the actual location while the orange turtule is the estimated location. The arrows are particles. Blue arrows stand for low probability particles while red arrows stand for high probability particles. There are four sensors installed on the front, back, left and right of the turtle. The sensors measure its perpendicular distances to the closest walls in four directions, possibly bounded by some sensor limit.

Particle Filter Start Particle Filter Equilibrated

Files

.
├── LICENSE.md
├── main.py
├── maze.py
└── README.md

Dependencies

  • Python 3.6
  • Numpy 1.14

Usages

The following parameters could be adjusted for the particle filter.

$ python main.py --help
usage: main.py [-h] [--window_width WINDOW_WIDTH]
               [--window_height WINDOW_HEIGHT] [--num_particles NUM_PARTICLES]
               [--sensor_limit_ratio SENSOR_LIMIT_RATIO]
               [--grid_height GRID_HEIGHT] [--grid_width GRID_WIDTH]
               [--num_rows NUM_ROWS] [--num_cols NUM_COLS]
               [--wall_prob WALL_PROB] [--random_seed RANDOM_SEED]
               [--robot_speed ROBOT_SPEED] [--kernel_sigma KERNEL_SIGMA]
               [--particle_show_frequency PARTICLE_SHOW_FREQUENCY]

Particle filter in maze.

optional arguments:
  -h, --help            show this help message and exit
  --window_width WINDOW_WIDTH
                        Window width.
  --window_height WINDOW_HEIGHT
                        Window height.
  --num_particles NUM_PARTICLES
                        Number of particles used in particle filter.
  --sensor_limit_ratio SENSOR_LIMIT_RATIO
                        Distance limit of sensors (real value: 0 - 1). 0:
                        Useless sensor; 1: Perfect sensor.
  --grid_height GRID_HEIGHT
                        Height for each grid of maze.
  --grid_width GRID_WIDTH
                        Width for each grid of maze.
  --num_rows NUM_ROWS   Number of rows in maze
  --num_cols NUM_COLS   Number of columns in maze
  --wall_prob WALL_PROB
                        Wall probability of a random maze.
  --random_seed RANDOM_SEED
                        Random seed for random maze and particle filter.
  --robot_speed ROBOT_SPEED
                        Robot movement speed in maze.
  --kernel_sigma KERNEL_SIGMA
                        Sigma for gaussian distance kernel.
  --particle_show_frequency PARTICLE_SHOW_FREQUENCY
                        Frequency of showing particles on maze.

To run particle filter using default parameters, simply run the following command in terminal:

$ python main.py

Demo

$ python main.py --num_particles 1000 --kernel_sigma 500 --random_seed 200

References

Beacon Based Particle Filter

Some of the code in this project were revised from the Beacon Based Particle Filter project. But the robot environment is totally different and the sensor measure mechanism is also totally different. The robot in this project could be more clumsy compared to the robot used in the Beacon Based Particle Filter project, but the particle filter still inferred the correct location and heading direction.

Notes

I found that if the number of particles is not sufficiently large, particularly for some complicated environment, such as the maze which looks quite similar in many local regions, and when the sensor is not perfect, sometimes it will take much longer time, after many rounds of particle reinitializations, to get the right location of the turtle. So the number of particles is definitely the most important parameters for particle filter. However, it slows down the computations.

If the number of particles is not sufficiently large, sometimes adjusting the standard deivation of Gaussian kernel might make it converges faster.

Although theoretically it is true, it is amazing to see that the particle filter could infer the heading direction of turtle correctly even if the sensor measurements do not contain direction information directly.

To-Do List

  • Remove compass from turtle.

Miscellaneous

Particle Filter Online

An interesting online particle filter that uses similar designs to mine.

More Repositories

1

Voice-Converter-CycleGAN

Voice Converter Using CycleGAN and Non-Parallel Data
Python
524
star
2

Frozen-Graph-TensorFlow

Save, Load Frozen Graph and Run Inference From Frozen Graph in TensorFlow 1.x and 2.x
Python
299
star
3

ONNX-Runtime-Inference

ONNX Runtime Inference C++ Example
C++
215
star
4

DeepLab-V3

Google DeepLab V3 for Image Semantic Segmentation
Python
146
star
5

PyTorch-Quantization-Aware-Training

PyTorch Quantization Aware Training Example
Python
119
star
6

Console-Snake

Snake Game in Console Implemented Using C++
C++
114
star
7

CUDA-GEMM-Optimization

CUDA Matrix Multiplication Optimization
Cuda
110
star
8

Two-Layer-Hierarchical-Softmax-PyTorch

Two-Layer Hierarchical Softmax Implementation for PyTorch
Python
68
star
9

Singing-Voice-Separation-RNN

Singing-Voice Separation From Monaural Recordings Using Deep Recurrent Neural Networks
Python
60
star
10

Rotated-Rectangle-Crop-OpenCV

Rotated Rectangle Crop Function for OpenCV
Python
52
star
11

PyTorch-Pruning-Example

PyTorch Pruning Example
Python
46
star
12

gRPC-Examples

gRPC Beginner's C++ Examples with CMake
C++
45
star
13

Sampled-Softmax-PyTorch

Sampled Softmax Implementation for PyTorch
Python
43
star
14

PyTorch-Static-Quantization

PyTorch Static Quantization Example
Python
39
star
15

LibTorch-ResNet-CIFAR

ResNet Implementation, Training, and Inference Using LibTorch C++ API
C++
34
star
16

Docker-WeChat

Run WeChat Using Docker
Dockerfile
34
star
17

Protocol-Buffer-Examples

Google Protocol Buffer 3.0 Beginner's C++ and Python Examples with CMake
Python
31
star
18

CPP-Debug-Docker

Debug C/C++ Programs In Docker
C++
26
star
19

Wine-Docker-Image

Wine Docker Image to Run Windows Applications
Dockerfile
23
star
20

TensorRT-Custom-Plugin-Example

Quick and Self-Contained TensorRT Custom Plugin Implementation and Integration
C++
23
star
21

Simple-Inference-Server

Inference Server Implementation from Scratch for Machine Learning Models
Python
23
star
22

Siamese_Network_MNIST

Siamese Network on MNIST Dataset
Python
17
star
23

Boost-Docker

Docker for Boost C++ Library
Dockerfile
17
star
24

Nsight-Systems-Docker-Image

Nsight Systems in Docker
Dockerfile
17
star
25

Sphinx-CPP-TriangleLib

Using Sphinx to Document C++ Libraries
C++
15
star
26

ONNX-Python-Examples

ONNX Python Examples
Dockerfile
15
star
27

PPMIO

PPM Image I/O Library for C/C++
C++
14
star
28

What-Is-The-Date-Today

GitHub Self-Updating Repository Using GitHub Scheduled Actions
12
star
29

OpenAI_Gym_AI

These are my learning algorithm solutions to OpenAI Gym environments.
Python
11
star
30

PyTorch-Eager-Mode-Quantization-TensorRT-Acceleration

TensorRT Acceleration for PyTorch Native Eager Mode Quantization Models
Python
11
star
31

Nsight-Compute-Docker-Image

Nsight Compute in Docker
Dockerfile
11
star
32

Tensorflow_Assignment_Solutions

These are my solutions to all six assignments of tensorflow tutorial in Udacity, covering CNN, RNN, Regularization (L2 and dropout), Embeddings (word2vec) and Seq2Seq LSTM (bigrams prediction and sequence mirror)
Jupyter Notebook
10
star
33

Doxygen-CPP-TriangleLib

Using Doxygen to Document C++ Libraries
C++
10
star
34

Image-Converter-CycleGAN

Image Converter Using CycleGAN and Non-Parallel Data
Python
9
star
35

PyTorch-Dynamic-Quantization

PyTorch Dynamic Quantization Example
Python
9
star
36

Ramachandran

Ramachandran Plot Tool
Python
8
star
37

CPP-Treasure-Bay

A Collection of C++ Basic and Advanced Usages
C++
7
star
38

TensorFlow_Dataset_API_Demo

Efficient Dataset Loading Using TensorFlow Dataset API
Python
6
star
39

Flappy_Bird_AI

Flappy Bird Artificial Intelligence
Python
5
star
40

DockerFiles

Collection of Dockerfiles Used for Different Purposes
Dockerfile
5
star
41

Console-Player

Audio Player in Console Implemented Using C/C++
C++
5
star
42

TensorRT-Docker-Image

TensorRT in Docker
Dockerfile
5
star
43

Pixabay-AsyncIO-Download

Download Pixabay Images Using Python AsyncIO
Python
5
star
44

PyTorch-Automatic-Mixed-Precision-Training

PyTorch Automatic Mixed Precision Training Example
Python
5
star
45

Dota2-Profile-Pictures

Dota2ćäž»æ’­ć€ŽćƒïŒŒéƒšćˆ†çš€æœ‰ïŒŒæ‰Žćźžă€‚
Shell
4
star
46

Auto-Red-Eye-Remover

Automatic Red Eye Removal From Photos Using C++ and OpenCV
C++
4
star
47

Drunken-Sniper

Modified 64.0 Game Implemented Using Jack Language and Run in Nand2Tetris VM Emulator
HTML
4
star
48

Convolutional_Neural_Network_CIFAR10

Object-Oriented Convolutional Neural Network for CIFAR10 Dataset
Python
4
star
49

Sphinx-Python-TriangleLib

Using Sphinx to Document Python Libraries
Python
4
star
50

Intelligent_Mouse

Maze Explorer and Solver
Jupyter Notebook
3
star
51

CMake-Examples

CMake Examples for Noobs
CMake
3
star
52

Heroku-Docker-Example

Deploy Docker Applications on Heroku
Python
3
star
53

ABI-Breaking-Change-Demo

ABI Breaking Change Demo
C++
3
star
54

Image_Resizer

Image Resizer Web App Coded in Python
Python
2
star
55

leimao

2
star
56

PNGs_to_GIF

This is a script that transforms png-formatted images to gif-formatted animated image.
Python
2
star
57

Docker-Chess

Playing Chess Using SCID-VS-PC in Docker Container
Dockerfile
2
star
58

CPP-Public-Header-Abstract-Class-Declarations-Example

Using Abstract Class Declarations for Hiding Private Methods and Members
C++
2
star
59

Decision_Tree_Python

Efficient Implementation of Decision Tree from Scratch in Python
Python
2
star
60

Directory-Tree-Printer

Useful Directory Tree Printer
C++
2
star
61

Blog-Images

Hosting Images for Lei Mao's Log Book
JavaScript
2
star
62

MPCS_Programming_Placement_Exam

These are my solutions to the programming placement exam of the MPCS program at The University of Chicago.
HTML
2
star
63

Di-Tech_Algorithm_Challenge_2016

Didi Taxi is a mobile platform taxi-calling application in China. It has acquired Uber's China operations in 2016 with the capital from Apple. It hosted an machine learning algorithm contest in 2016 in order to solve the demand-supply problem of Didi taxi. I took part in the contest in 2016 when I was still studying at Duke University. This is my solution to the problem. My teammates also includes Guotu Li from Duke University and Jianhai Zhang from Dalian University of Technology.
Jupyter Notebook
2
star
64

UD282_Java_Programming_Basics

Assignment Solutions for UD282 Java Programming Basics at Udacity
Java
1
star
65

PyTorch-Automatic-Differentiation

PyTorch Automatic Differentiation Forward Mode and Reverse Mode Using autograd and functorch
Python
1
star
66

WikiMidas

Wikipedia Data Crawler
Python
1
star
67

TTIC_Deep_Learning_2018_Pareto_Competition

2018 Fundamentals of Deep Learning (TTIC 31230) Course Project - Language Modeling
Python
1
star
68

Thinkpad_Manuals

Thinkpad Manuals
1
star
69

Audience_SQL_Database

Audience SQL Database is a SQLite3 database designed for the management of the information of the VIP audience of China Dalian TV.
Python
1
star
70

Deep_Learning_Papers

Library of Deep Learning Papers
1
star
71

Automated_Environment_Configurations

Environment Configuration Bash Scripts for New Operating Systems
Shell
1
star
72

Image_Blurring_CUDA

RGB Image Blurring Using CUDA and CMake
Cuda
1
star
73

Stanford_CS229_Machine_Learning

Stanford CS229 Machine Learning Course Materials @ http://cs229.stanford.edu/materials.html
MATLAB
1
star
74

Logistic_Regression_Python

Efficient Implementation of Logistic Regression from Scratch in Python
Python
1
star
75

Document_Clustering_and_Retrieval

This is an unsupervised learning project to cluster and retrieve documents of similar topics. This is also my solution to the Document Clustering and Retrieval project in Machine Learning Specialization Courses at Coursera.
Jupyter Notebook
1
star
76

Semantic-Segmentation-CARLA

Semantic Segmentation Using CARLA Synthetic Dataset
Python
1
star
77

Data_Structures_and_Algorithms

These are the solutions to the assignments in Coursera Data Structures and Algorithms Specialization.
C++
1
star
78

MoeGirlMidas

MoeGirlMidas is a spidering program to crawl fictional characters' data from MoeGirl (https://zh.moegirl.org/Mainpage).
Jupyter Notebook
1
star
79

SPIEC_EASI_Analysis

This is a R and Python script to analyze the associations between different microbiome taxonomies using SPIEC-EASI.
Jupyter Notebook
1
star
80

PyTorch-Variational-Autoencoder

PyTorch Variational Autoencoder Example
Python
1
star
81

XLSX_to_CSVs

Transform the worksheets in Excel xlsl file to multiple csv files.
Python
1
star
82

Python_for_Everybody_Capstone

This is the capstone projects for the "Python for Every Body" Coursera Specialization. It includes some basic codes for data crawling from the web and data visualization using Python.
JavaScript
1
star