Practice the ROS2 Point Cloud Floor Plane Segmentation coding problem in Perception. Browser-based execution with automated grading — no local ROS install required. 58% of engineers pass this challenge.
Implement ransac_floor(pcd, max_iters, distance_thresh, min_inliers) that segments the dominant floor plane from a 3D point cloud.
def ransac_floor(
pcd: np.ndarray, # Nx3 array of (x, y, z) points
max_iters: int = 100,
distance_thresh: float = 0.02,
min_inliers: int = 10
) -> tuple[np.ndarray, np.ndarray, tuple]:
(floor_indices, nonfloor_indices, plane_model) where:
floor_indices: 1D integer array of indices into pcd that are on the floornonfloor_indices: 1D integer array of remaining point indicesplane_model: tuple (a, b, c, d) where ax + by + cz + d = 0 and the normal (a,b,c) is unit lengthFor each iteration:
pcdv1 = p1 - p0, v2 = p2 - p0n = cross(v1, v2)|n| < 1e-6 (collinear points)n = n / |n|d = -dot(n, p0)|ax + by + cz + d| < distance_threshAfter all iterations:
min_inliers inliers, return those indices as floor(np.array([]), np.arange(len(pcd)), (0,0,1,0))This is exactly what pcl::SACSegmentation with SACMODEL_PLANE does internally in the PCL library — the C++ library used in every industrial robot perception pipeline. Understanding the algorithm from scratch lets you tune it (iterations, threshold) and debug cases where it fails (multi-layer floors, reflective surfaces).
It is a hands-on Perception challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.
Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.
This Hard problem focuses on point-cloud, ransac, plane-segmentation skills used in robotics interviews and production systems.