Neato Particle Filter

Mobirise Website Builder

About the Project

As a robot, knowing where you are accurately and quickly is a big challenge - and an important one. This project in particular focused on the creation and implementation of a particle filter, an algorithm that uses odometry and sensor readings to pinpoint the location of the robot in a given map. The filter was created using Python and ROS2 on a Neato. After taking the odometry and LIDAR readings, the particle filter generates a series of guesses on where the robot is inside the map. The filter itself is initialized with a randomly distributed set of particles which represent possible positions and orientations of the robot in the map and a guess at the robot’s initial position.

Researching Tools

This challenge can be addressed by employing a particle filter algorithm, aiming to determine the robot's most probable location at a given time while considering sensor noise. The fundamental concept of a particle filter involves initializing particles across a designated map to represent various potential poses (comprising position and orientation) of the robot.

In Figure 2, the initiation of the particle cloud surrounding the initial robot pose estimate is illustrated, while the actual position of the robot in Gazebo is depicted in Figure 1. Notably, the red cluster of particles is generated around the initial position. As the robot traverses its environment, these particles are continually adjusted, simulating its movements while incorporating sensor-related imperfections, thereby reflecting the robot's actual location rather than solely relying on the odometry sensor's reported position.

Mobirise Website Builder

Figure 2

Mobirise Website Builder

Figure 1

Mobirise Website Builder

Figure 3


To assess the likelihood that a particular particle accurately represents the robot's actual location, the laser scans published by the robot are overlaid onto the map based on each particle's frame. The comparison of these scans with the authentic scan is then used to determine the degree of similarity. Consequently, particles with scans exhibiting high similarity to the genuine scan are assigned greater weights, indicating a higher likelihood of accurate poses. The particle filter derives its optimal estimation of the robot's true pose by averaging the poses of all particles.

As depicted in Figure 3, the effectiveness of the particle filter is evident in the alignment between the red laser scan on the map and the actual map presented in black and white. A more precise alignment signifies improved performance of the particle filter.

Mobirise Website Builder

Figure 4


This iterative procedure is recurrently executed, involving the resampling of particles based on their weights. Consequently, in the subsequent iteration, more particles are initiated in regions of the map where particles with elevated weights existed in the previous iteration. This repetition continues until the particles converge around the area deemed most probable for the robot's location.

Should the particle filter exhibit indications that its prediction of the robot's pose has deviated significantly, a remedy involves providing the filter with a new initial estimate, effectively "resetting" the filter. The process of endowing the filter with a fresh initial pose through Rviz is illustrated in Figure 4. The green arrow symbolizes the new pose, with its orientation represented by the direction and its x, y position indicated by the tail.

The code implementation of the particle filter can be outlined at a high level as follows:

1. Initiate a set of particles in the map frame through random sampling.
2. Update the particles using data from the robot's odometry in the odom frame.
3. Adjust the weights of the particles based on their agreement with the laser scan (provided in the baselink frame).
4. Resample a fresh set of particles with replacement, where the probability of selection is proportional to their weights.
5. Revise the estimation of the robot's pose with the newly sampled particles and update the map to odom transform.

Carlo Colizzi 2024 - Olin College of Engineering

AI Website Builder