How a Robot Measures Distance: Two Eyes Versus a Light Pulse
Your robot vacuum does not see a staircase. It reads a distance, and a bad reading can send it over an edge. Two common ways to measure distance are stereo cameras and time-of-flight sensors. Each one fails in its own way.
Two eyes: how stereo cameras work
Hold a finger up and close one eye, then the other. The finger seems to jump sideways. Your brain uses that jump to judge how far away the finger is.
A stereo camera does the same job with two lenses placed side by side. The software finds the same spot in both pictures. The spot sits at a slightly different place in each one. Engineers call that shift the disparity. The closer the object, the bigger the shift.
The hard part is finding the matching spot. A plain wall or a blank floor gives the software nothing to lock onto. The MIT Visionbook, a free computer vision textbook, lists lack of texture as a main cause of errors.

A light pulse and a stopwatch: how time-of-flight sensors work
A time-of-flight sensor works a bit like a bat’s call, but with light. It sends out a short pulse of infrared light. Infrared is light your eyes cannot see. The sensor then times how long the pulse takes to bounce back.
Light travels so fast that the time is tiny. The sensor takes half the trip there and back and multiplies it by the speed of light. Mouser, an electronics supplier, describes this method and a second one that reads the rhythm of a steady light wave.
Which one is in your robot, and how it fails
Check the spec sheet. Words like stereo or two cameras point to the first method. Words like ToF or time-of-flight point to the light pulse.
Many floor robots also carry small infrared sensors on their underside. Eufy, a vacuum maker, says these detect edges so the robot does not fall down stairs. Its support page says the sensors run on infrared and cannot reliably detect dark floors.
Dark floors can fool light sensors
Dark colours soak up infrared light. The sensor then gets very little light back. Eufy says dark-coloured surfaces absorb infrared signals, and a floor has to be close to pitch-black for this to matter.
You will notice it when the robot stops at a black mat or turns away from a dark rug. To test it, lay a black towel on a plain floor and watch. If the robot backs away from the towel, it has the same fault.

Bright sunlight can also confuse the sensor. Eufy warns that direct sunlight can bounce off hard floors. If the robot turns away from a sunny patch for no clear reason, run it when that patch is in shade.
Cameras struggle with blank surfaces
A stereo camera fails for the opposite reason. It needs texture, such as wood grain, a pattern or a seam. A blank wall gives it nothing to match. The MIT text says software then has to fill the gaps with filtering and interpolation.
Judge the sensor by what it cannot see
A camera struggles with plain surfaces. A light pulse struggles with dark ones. Look at your floors before you pick a robot, and check which sensor its spec sheet names.
