Skip to content

A fast particle filter localization algorithm for the MIT Racecar. Uses RangeLibc for accelerated ray casting.

Notifications You must be signed in to change notification settings

shineyruan/particle_filter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Landmark Enhanced Localization based on Particle Filter

This is the localization module for 2021 Independent study: CAD2CAV which focuses on multi-agent indoor navigation using floor map information.

Pure Localization

Localization is done using MCL algorithm using a reference occupancy map generated from the floor plan using Auto Mapping.

The localization performance using particle filter only:

DEMO

Landmark enhancement

To utilize as much information as possible from the floor map, detect landmarks that have been marked in floor plan to enhance localization in narrow hallway and/or big empty space. The landmark detection module uses a fine tuned YOLO model to do real-time object detection, and by comparing the landmark detection with floor plan we can update the particles accordingly. Read this for an algorithm walkthrough.

The localization performance with landmark detection:

DEMO

Installation

To run this, you need to ensure that both the map_server ROS package, and the python wrappers for RangeLibc are installed.

For the map server:

sudo apt-get update
rosdep install -r --from-paths src --ignore-src --rosdistro kinetic -y

For RangeLibc:

sudo pip install cython
git clone http://github.com/kctess5/range_libc
cd range_libc/pywrappers
# on VM
./compile.sh
# on car - compiles GPU ray casting methods
./compile_with_cuda.sh

Usage

The majority of parameters you might want to tweak are in the launch/localize.launch file. You may have to modify the "odometry_topic" or "scan_topic" parameters to match your environment.

roslaunch particle_filter localize.launch

To enable the Rviz for particle and trajectory visualization, as well as video playback, use:

roslaunch particle_filter localize_viz.launch

Once the particle filter is running, you can visualize the map and other particle filter visualization message in RViz. Use the "2D Pose Estimate" tool from the RViz toolbar to initialize the particle locations.

See launch/localize.launch for docs on available parameters and arguments.

The "range_method" parameter determines which RangeLibc ray casting method to use. The default is cddt because it is fast and has a low initialization time. The fastest option on the CPU is "glt" but it has a slow startup. The fastest version if you have can compile RangeLibc with CUDA enabled is "rmgpu". See this performance comparison chart:

Range Method Performance Comparison

Docs

This code is the staff solution to the lab guide found in the /docs folder. A mathematical derivation of MCL is available in that guide.

There is also documentation on RangeLibc in the /docs folder.

The code itself also contains comments describing purpose of each method.

Cite

This library accompanies the following publication.

@article{walsh17,
    author = {Corey Walsh and 
              Sertac Karaman},
    title  = {CDDT: Fast Approximate 2D Ray Casting for Accelerated Localization},
    volume = {abs/1705.01167},
    url    = {http://arxiv.org/abs/1705.01167},
    year   = {2017}}

About

A fast particle filter localization algorithm for the MIT Racecar. Uses RangeLibc for accelerated ray casting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.2%
  • CMake 15.8%
  • C++ 2.0%