Abstract
The essence of simultaneous location and mapping (SLAM) is an estimation problem requiring mobile robots to use sensor information to estimate environmental structure and their own position in real-time. While the Extended Kalman Filter (EKF) is a cornerstone of SLAM technology, standard implementations face challenges with data management. Specifically, when the number of stored landmarks reaches a memory threshold, many systems discard all existing data, leading to computational waste and significant error spikes. This paper proposes several improvement methods for the ROS-based EKF-SLAM, including a Least Recently Used (LRU) data logic, weighted landmark updates, and retaining user data during updates. These methods aim to provide a more precise outcome with a reduced error range.
The Data Overflow Problem in EKF-SLAM
EKF-SLAM relies on three primary equations: the equation of motion, the landmark initialization equation, and the projection equation for state updates. However, the computational complexity of updating the covariance matrix scales quadratically ($O(n^2)$) with the number of landmarks ($n$). To maintain real-time performance on limited hardware, such as Raspberry Pi or STM32 systems, developers often implement a hard limit on the number of stored landmarks.
The traditional approach of "dumping" all landmark data upon reaching this threshold creates two critical failures:
- Instant High Error: The sudden loss of all environmental anchors causes a massive spike in positioning uncertainty.
- Data Waste: High-quality historical data is discarded, forcing the robot to rely on potentially noisier new observations.
Proposed Optimization Strategies
To address these issues, this research introduces three optimization layers:
1. Least Recently Used (LRU) Stack
Instead of a total data wipe, the system implements an LRU logic. Landmarks are tracked in a stack; whenever a landmark is re-observed, it is moved to the top. When the memory threshold is reached, only the bottom half of the stack—the least recently seen landmarks—is discarded. This preserves the most relevant "anchor points" for the robot's current vicinity.
2. Weighted Landmark Updating
The system moves away from treating every observation as a new landmark. Instead, it updates existing landmarks using a weighted balance. Observations made at "optimal" distances—where Lidar resolution is high and relative error is low—are prioritized. This "Goldilocks zone" approach ensures that the map converges toward the most accurate possible representation.
3. Individual Compatibility Nearest Neighbor (ICNN)
To ensure computational stability, the algorithm localizes data association. By comparing sensor data only to landmarks within the robot's immediate vicinity, the system maintains a predictable update time regardless of the total map size, preventing lag-induced navigation errors.
Experimental Results
The proposed methods were tested in a ROS simulation environment featuring a $4 \times 4$ matrix of cylindrical landmarks.
As shown in the error analysis above, the system maintains a low and stable error profile. During simulation runs, the average error remained near 0.03m, avoiding the catastrophic spikes seen in traditional "dump-all" implementations.
The path tracking results demonstrate that the EKF-estimated path closely follows the ground truth. The system successfully corrects short-term drift, particularly during abrupt turns, maintaining long-term consistency through the retention of high-quality landmark data.
Conclusion
By replacing crude data-clearing logic with intelligent LRU management and weighted updates, EKF-SLAM can achieve significantly higher precision on resource-constrained hardware. These optimizations ensure that the robot retains its most valuable environmental knowledge, leading to smoother localization and more reliable mapping. Future work will focus on adapting these methods for non-uniform, complex environments beyond simple cylindrical landmarks.
Summary updated