FixTheRobot Explore Robotics / Perception / P5 / P5-L2

This lab works on phones, but writing code is much easier on a laptop.

Perception · 3D Perception and Point Clouds · P5-L2 · Intermediate

Fit a Ground Plane Robustly

A robot drives up a ramp. Its obstacle detector worked on the flat factory floor, but on the ramp it reports a wall of obstacles in front of it: the road itself.

You will see why a height threshold cannot handle a slope, estimate the ground plane from the data with RANSAC, and clean up the ground removal.

Your task

    Simulation
    solution.pyLoading Python…
    Ctrl+Enter runs
    What Python can I use?

    Plain Python with math (and slamkit for small matrix helpers: matmul, transpose, solve, inverse, identity). Images, point clouds and detections arrive as lists inside the dictionary D; an image is a list of rows, each row a list of pixels. There is no NumPy or OpenCV: you write the algorithm yourself, which is the point of the lab. Print with print().

    Hints

    What this lab teaches

    Stage 1 is an experiment on the flat-ground assumption. Stage 2 writes a RANSAC plane fit. Stage 3 refits the plane by PCA and removes the ground with a tolerance that grows with range. Your code is graded on hidden scenes with different slopes, rolls and obstacles; the simulator keeps the true ground labels and the true plane private. It goes beyond the Sensors lab, which removes ground with a height threshold on flat floors.

    Theory for this lab

    3D Perception and Point Clouds labs

    1. P5-L1: Estimate Surface Normals and Planarity
    2. P5-L2: Fit a Ground Plane Robustly: this lab.
    3. P5-L3: Debug a Failed 3D Detection Pipeline

    Educational simplification: a simulated 20-ring LiDAR 1.2 m above a planar ground (slopes from −3° to 6°, rolls up to 1.5°) with three or four box obstacles, a 90° field of view and range noise of 2 cm plus 0.2 cm per metre. Real ground is not a perfect plane, and real sensors have 16 to 128 rings, motion distortion and dropouts. All data in this lab are simulated.

    Get the next lab

    Get notified when new robotics labs are released. One email per new lab, nothing else.