# Difference between SLAM and Localization

What are the differences between SLAM and Localization if you have a known map? How does the position probability update differ between the two?

In particular I'm curious on if localization is a fundamentally easier problem give you have map.

I have a virtual environment with a simulated LIDAR sensor and a known map. I want to try implementing localization but I'm not completely sure how to do it - you can do IPCM over the whole space but this is a very poor idea if you have a strong prior on where the robot started a sequence of sensor values/actions up until your current location.

Localization is always done with respect to a map.

SLAM(Simultaneous Localization and Mapping). As it is in the name, also does localization with respect to a map. The only difference is that the map is unavailable so it has to create it. It is simultaneously creating a map, and then localization itself against it.

How does the position probability update differ between the two?

Mathematically they end up being the same thing. Just that in SLAM typically the uncertainty of the map is a factor in the position probability. (Should be done in localization to, but is sometimes ignored)

In particular I'm curious on if localization is a fundamentally easier problem give you have map.

Yes. As the map can be created offline you can spend a lot more computing power, and do a lot more refinement to ensure you have a high quality map. SLAM basically has to do everything in real time.

This is why actually most autonomous car companies don't do SLAM, they do mapping and localization separately. They first run there cars through a city to generate high quality maps. Then when it is running autonomously it is just localizing itself against that map.

If you have a strong prior then just remove the parts of the pointcloud that you know will not be in range. You also want to make sure that your ICP algorithm is robust against outliers.

• Ah thanks, thinking about this for example you can run point cloud matching by itself checking for a local set of transformations associated with your most recent movement or you can do a full Bayesian EKF or particle filter to gain a probability distribution of your next location. I'm still a bit confused though on how the EKF localization process works without the map update. Mar 24, 2020 at 17:08
• Particle filters are typically better for pure localization. Your global pointcloud/map was created with respect to some origin. If you now run your pointcloud matching algorithm it will output a pose(translation,rotation). This pose is passed on to the EKF/particle filter for the update step, and is your localized pose. A basic EKF example can be found here. Though it does landmarks instead of pointcloud. (Even though it says SLAM it is actually pure localization) Mar 24, 2020 at 23:35
• If you were to do full slam your state vector would be [pose,map(landmark1(x,y),landmark2,...)]. Then when you do the Kalman filter update you update your pose and the landmark position. So you will actually have 2 jacobians. One that updates the pose and the other one which updates the map. How these landmarks are initialized is dependent on the problem and sensors. You have 2 pointclouds global and what your sensor sees now. The global pointcloud has some origin. If you run ICP it will give you a position with respect to the origin. Mar 25, 2020 at 19:14
• Covariance calculation is a bit complicated. I can't give you an easy method. Generally you solve ICP through a nonlinear least squares solver. If you do that then the covariance is the Hessian matrix. See ceres-solver.org/nnls_covariance.html Also I want to be clear that the EKF example I gave you with landmarks is different than how you would deal with pointclouds. Was just to show you how an update could work for localization. Mar 25, 2020 at 19:21
• LIDAR's can be processed in multiple ways. The first is landmark based. You extract features like planes and corners from a lidar scan. And match them to another set of landmarks extracted from a previous scan. The other way is scan matching/ICP. You instead match the whole LIDAR scan to a previous one. You match the whole pointcloud rather than a subset of landmarks. Mar 25, 2020 at 20:22

edwinem already explains pretty well, let me add a couple of parts.

There are two major scenarios (actually many more) making SLAM more difficult than localization.

1) Revisiting: When creating a map, accumulated errors in a map is inevitable. When a robot revisits a same location after traveling a loop, the robot needs to determine if this environment is a new location or a part of map. This is especially more difficult, if the environment has similar patterns. Unfortunately, our living environment has many similar patterns.

2) Kidnapping: For many reasons, a robot lost its location completely. This case, recreation of a map with data association is a big challenges.

• Only really the accumulated map errors is unique to SLAM. The other 2 also happen in localization. 1 is called aliasing, and the kidnapped robot problem also occurs in localization. Mar 28, 2020 at 4:37