Simultaneous Localization and Mapping (SLAM) for absolute beginners
Given a mobile robot equipped a set of sensors, we now know how to build a map and localize the robot with respect to the map. But there is one catch- for mapping, we assumed that the robot is given its location as it moves. And, for localization, we had assumed a map of the environment to be given, a priori.
In real life, often times a robot is deployed in completely unknown environments. This means that neither a map nor the (starting) location are known a priori and hence the need for Simultaneous Localization and Mapping or SLAM for short.
Let us dive deeper into the challenges that arise by doing these co-dependent tasks simultaneously and how these are addressed.
What is Simultaneous Localization and Mapping (SLAM)?
Simultaneous localization and mapping, or SLAM for short is the process of creating a map of an unknown environment while at the same time localizing the robot within the map. This means that the robot needs to build a map at the same time as it discovers its location.
This makes the SLAM task extremely challenging since both the location and the map need to be updated concurrently, without the luxury of any prior information. In other words, it becomes a chicken-and-egg problem: How can the robot simultaneously localize itself and build the map if it doesn’t have its location relative to the map? And how can the robot correctly build the map if its initial location estimate is wrong?
Why is SLAM challenging?
The challenge with SLAM lies in the fact that we cannot rely on prior map information and the location of the robot. We need to seek all the information while the robot is in motion and build the map and localize the robot in real-time. This involves numerous challenges that need to be addressed including:
Sensor noise: sensor readings are highly prone to noise. Hence, the data needs to be cleaned and filtered to make sense of it.
Motion dynamics: the robot’s motion dynamics (position, speed, acceleration, etc) need to be accounted for over time in order to accurately localize the robot and build a map.
Data association: matching the current sensor readings with the landmarks is a challenge in unknown environments and picking incorrect data associations, will result in incorrect estimates and incorrect decisions.
Perceptual aliasing: very often, the same features in different locations are perceived to be the same by the robot. This could be either be the result of noisy sensor observations or the drift in the robot’s odometry over time making it believe it is in a different place than it actually is.
This is also known as the loop closure detection problem wherein the robot needs to understand that it has come back to a previously known location and rectify such drifts and hence, close the loop.
Curse of dimensionality: a map is a spatial representation of the environment and there can be numerous such spatial representations for each environment that needs to be filtered through as more sensor data is acquired.
On top of this, with respect to each such probable “map”, there are numerous probable locations in which the robot can be present at any given point in time.
Thus, all such joint possibilities of map X locations grows exponentially given the size of the environment.
Computational and memory complexity: As the robot moves around in its environment and gathers more data, the amount of information stored to maintain the map grows. Thus, there is a need to compress and maintain the size of the data retained to build the map over time.
What are the approaches to solving SLAM problem?
SLAM is approached in two ways: Classical SLAM (C-SLAM) and Probabilistic SLAM (P-SLAM).
Classical SLAM is a non-Bayesian approach in which the factorized SLAM problem is solved using least squares. This entails that the robot is assumed to be running the same linear motion model between each time step.
This means that it is assumed that the robot is moving at a constant speed without accelerating and that the measurements taken by the robot are accurate.
Therefore, C-SLAM is suitable when the robot is moving in a structured manner without having to make any drastic changes in its motion.
The overall process is divided into 3-steps:
Data Association: the robot needs to first identify which of the features from the previous time step are related to the features from the current time step.
Pose Estimation: the robot then uses the associated features from the last time step and from the current time step to estimate its current pose.
Optimization: finally, the robot performs optimization over the estimated poses (positions and orientations) to ensure that the poses are as accurate as possible.
Probabilistic SLAM (P-SLAM) is a Bayesian approach which models the SLAM problem as a probabilistic inference over a graphical model.
This means that the robot is not assumed to be running the same linear motion model between each time step and the measurements taken by the robot can be noisy. Therefore, P-SLAM is suitable when the robot is moving in unstructured environments where there is a need to make drastic changes in its motion.
The sequence of the steps is slightly different from C-SLAM: prediction → Data association → Pose estimation.
SLAM is an incredibly challenging problem that requires the robot to localize itself and build a map of the environment, simultaneously. While there are many approaches to addressing the SLAM problem, each approach has its own pros and cons. As such, careful evaluation of the tradeoff between accuracy and complexity is critical when using SLAM for autonomous mobile robot navigation.