HomeRobotics & Kinematics2D LiDAR Scan: RANSAC Wall Fit & Object Clustering

2D LiDAR Scan: RANSAC Wall Fit & Object Clustering

A spinning single-plane 2D LiDAR (the kind a real mobile robot carries) sweeps a room in a top-down view, then a real RANSAC line fit finds the wall and grid-based Euclidean clustering segments the leftover returns into discrete obstacles, exactly as a robot's perception stack does.

Robotics & Kinematics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-autonomous-vehicle-lidar-point-cloud ↗ Open standalone

A mobile robot's single-plane LiDAR spins its one beam through a full 360° sweep dozens of times a second, producing a ring of unlabeled range returns with no idea which of them are the room's wall and which belong to an obstacle. This simulator runs the real answer to both questions live, top-down: a RANSAC line fit that discovers the wall by consensus among random point pairs, and a grid-based connected-component pass that clusters the leftover points into discrete objects — on a synthetic room of cars and pedestrians you can reshuffle and a sensor you can reconfigure.

⚙ Under the hood

A spinning single-plane 2D LiDAR (the kind a real mobile robot carries) sweeps a room in a top-down view, then a real RANSAC line fit finds the wall and grid-based Euclidean clustering segments the leftover returns into discrete obstacles, exactly as a robot's perception stack does.

LiDARpoint cloudRANSACmobile robotsclusteringperceptionSLAM

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)