Filtering LiDAR outliers: why SLAM maps look speckled
Atlasbot · 18/8/2026 · 11 min read
Running SLAM for the first time, many people were surprised when the maps were not as clean as the demo — there were sporadic dots appearing in the middle of the gaps, or the walls were unusually "thick". Much of the cause comes from noise in raw LiDAR data, which has not been filtered before inclusion in SLAM.
Key concepts
Four common sources of noise in raw LiDAR data:
- Poorly reflecting or transparent— glass, jet black matter, or surfaces reflect laser beams that go differently instead of reflecting straight toward the sensor, causing false measurement intervals or missing points
- Random noise — even normal surfaces, low-cost LiDAR triangulation still has a few percent error at long distances (What is LiDAR learned in the LiDAR problem?) — manifested as light "rung" points around ground truth
- Dynamic object — people moving sideways through during scan are recorded as a temporary "obstacle"
- Single (outlier) ghosts— sometimes appear completely absurdly in empty space due to electronic interference or cross-reflection from nearby objects
How it works
The laser_filters package provides multiple filters that can be inserted into the pipeline before the data reaches the SLAM, configured via YAML without writing code:
scan_filter_chain:
- name: range_filter
type: laser_filters/LaserScanRangeFilter
params:
lower_threshold: 0.12 # drop point closer than reliably measured LiDAR level
upper_threshold: 8.0 # drop point further than real-world scan range
- name: speckle_filter
type: laser_filters/LaserScanSpeckleFilter
params:
max_range_difference: 0.2 # merge/sporadic point types unusually different from neighboring points
Range filter removes points that fall outside the sensor's reliable measurement range. Speckle filter detects and sorts singular points that are unusually different from neighboring points — dealing with the correct type of "ghost points" that are commonly encountered. Shadow filter sorts points that are at sweep angles almost parallel to the obstacle surface, where the triangulation error is greatest (what is the correct angle/spacing reduction accuracy problem learned in the LiDAR problem?).
Technical details
Formulas
The speckle filter detects ghost spots by comparing distances between adjacent spots — the spot is eliminated if the difference exceeds the threshold:
Point i is considered an outlier if:
|range[i] - range[i-1]| > max_range_difference
VD: max_range_difference = 0.2m
range[i - 1] = 2.5m, range[i] = 4.8m (2.3m difference >> 0.2m)
→ range[i] removed from scan, as noise point
Parameters
| Filter | Handle Noise Type | Main parameter |
|---|---|---|
| Range filter | Points outside the reliable range | lower_threshold, upper_threshold |
| Speckle filter | Single ghost point | max_range_difference |
| Shadow filter | Surface parallel sweep angle error | Minimum angular threshold |
Practical applications
Noise in LiDAR data is normal, not the corrupted sensor sign — important is to filter the right type of noise before inputting it to the SLAM rather than letting the SLAM algorithm "gain" raw noise on its own. With AMR operating in environments with multiple glass/mirror surfaces (e.g., warehouses with glass partitions, areas near large windows), proper filter configuration before running SLAM helps avoid distortion of the map due to noisy data from these poorly reflective surfaces in the first place, rather than having to scan multiple times.
Practical example
# Run laser filters as an intermediate node before SLAM
ros2 run laser_filters scan_to_scan_filter_chain \
--ros-args --params-file scan_filter_config.yaml \
--remap scan:=/raw_scan --remap scan_filtered:=/scan
# SLAM subscribe / scan (filtered) instead of direct /raw scan
Compare filtering before/after on the same scan near a glass surface:
Before: 15 ghost points scattered in empty space (caused by incorrect glass reflections)
After filtering (speckle_filter max_range_difference=0.2):
→ 13/15 ghost points removed due to unusual differences from neighboring points
→ the remaining 2 happen to lie near the real contour and are difficult to distinguish
fully automatically — but noise is greatly reduced compared with the original raw data
Common mistakes
- Bypassing the filtering step, directing raw data to SLAM — as stated, so that the SLAM algorithm automatically harbors a much less clean map output than the previous filter.
- Setting
max_range_differencetoo small— can erroneously exclude both valid points at the acute/edge of the object (where the distance between the adjacent natural point is large), not only the noisy point. - Non-specific treatment of glass/mirror multiple-surface environments— as the example above requires a more detailed filter configuration for this particular environment rather than using a generic default parameter.
- Punishing the SLAM algorithm when the distortion map without quality checking of the input LiDAR data — should check and filter the raw data first, in accordance with the bottom-up debugging principle learned in other AMR architecture lectures.
Conclusion
Noise in LiDAR data is normal, not the — corrupted sensor sign, it is important to properly filter the type of noise before putting it into the SLAM rather than letting the SLAM algorithm "gain" raw noise on its own. Starting with laser_filters is sufficient for most indoor AMR cases before more sophisticated filtration techniques are required. This is the last article of LiDAR — the next Camera entry that goes into visual sensing, complementing what LiDAR can't "see".
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.