I built this mopping robot with LEGO EV3. The program makes the robot turn when the front infrared sensor detects a wall and move straight otherwise.
At first, the robot would sometimes keep turning in circles, so I added a routine that makes it reverse when the color sensor does not detect the wall as expected.
I mounted a mop on the back so that the robot could dry-mop the floor.