Monte Carlo localization
From Wikipedia, the free encyclopedia
Monte Carlo localization (MCL), also known as particle filter localization,[1] is an algorithm for robots to localize using a particle filter.[2][3][4][5] Given a map of the environment, the algorithm estimates the position and orientation of a robot as it moves and senses the environment.[4] The algorithm uses a particle filter to represent the distribution of likely states, with each particle representing a possible state, i.e., a hypothesis of where the robot is.[4] The algorithm typically starts with a uniform random distribution of particles over the configuration space, meaning the robot has no information about where it is and assumes it is equally likely to be at any point in space.[4] Whenever the robot moves, it shifts the particles to predict its new state after the movement. Whenever the robot senses something, the particles are resampled based on recursive Bayesian estimation, i.e., how well the actual sensed data correlate with the predicted state. Ultimately, the particles should converge towards the actual position of the robot.[4]
Consider a robot with an internal map of its environment. When the robot moves around, it needs to know where it is within this map. Determining its location and rotation (more generally, the pose) by using its sensor observations is known as robot localization.
Because the robot may not always behave in a perfectly predictable way, it generates many random guesses of where it is going to be next. These guesses are known as particles. Each particle contains a full description of a possible future state. When the robot observes the environment, it discards particles inconsistent with this observation, and generates more particles close to those that appear consistent. In the end, hopefully most particles converge to where the robot actually is.
State representation
The state of the robot depends on the application and design. For example, the state of a typical 2D robot may consist of a tuple for position and orientation . For a robotic arm with 10 joints, it may be a tuple containing the angle at each joint: .
The belief, which is the robot's estimate of its current state, is a probability density function distributed over the state space.[1][4] In the MCL algorithm, the belief at a time is represented by a set of particles .[4] Each particle contains a state, and can thus be considered a hypothesis of the robot's state. Regions in the state space with many particles correspond to a greater probability that the robot will be there—and regions with few particles are unlikely to be where the robot is.
The algorithm assumes the Markov property that the current state's probability distribution depends only on the previous state (and not any ones before that), i.e., depends only on .[4] This only works if the environment is static and does not change with time.[4] Typically, on start up, the robot has no information on its current pose so the particles are uniformly distributed over the configuration space.[4]
Overview
Given a map of the environment, the goal of the algorithm is for the robot to determine its pose within the environment.
At every time the algorithm takes as input the previous belief , an actuation command , and data received from sensors ; and the algorithm outputs the new belief .[4]
Algorithm MCL: for to : motion_update sensor_update endfor for to : draw from with probability endfor return
Example for 1D robot
Consider a robot in a one-dimensional circular corridor with three identical doors, using a sensor that returns either true or false depending on whether there is a door.
At the end of the three iterations, most of the particles are converged on the actual position of the robot as desired.
Motion update

During the motion update, the robot predicts its new location based on the actuation command given, by applying the simulated motion to each of the particles.[1] For example, if a robot moves forward, all particles move forward in their own directions no matter which way they point. If a robot rotates 90 degrees clockwise, all particles rotate 90 degrees clockwise, regardless of where they are. However, in the real world, no actuator is perfect: they may overshoot or undershoot the desired amount of motion. When a robot tries to drive in a straight line, it inevitably curves to one side or the other due to minute differences in wheel radius.[1] Hence, the motion model must compensate for noise. Inevitably, the particles diverge during the motion update as a consequence. This is expected since a robot becomes less sure of its position if it moves blindly without sensing the environment.
Sensor update
When the robot senses its environment, it updates its particles to more accurately reflect where it is. For each particle, the robot computes the probability that, had it been at the state of the particle, it would perceive what its sensors have actually sensed. It assigns a weight for each particle proportional to the said probability. Then, it randomly draws new particles from the previous belief, with probability proportional to . Particles consistent with sensor readings are more likely to be chosen (possibly more than once) and particles inconsistent with sensor readings are rarely picked. As such, particles converge towards a better estimate of the robot's state. This is expected since a robot becomes increasingly sure of its position as it senses its environment.








