3 ms·
The Roomba always felt like these coding exercises of a ball bouncing off the screen limits: IF X > 600 || X < 1 THEN VX = -VX + RAND IF Y > 600 || Y < 1
by KingOfCoders 2y ago
The Roomba always felt like these coding exercises of a ball bouncing off the screen limits:
IF X > 600 || X < 1 THEN VX = -VX + RAND
IF Y > 600 || Y < 1 THEN VY = -VY + RAND
- Animats 2y agoClose. Brooks once described the Roomba algorithm as something like this: 1. Go in a random direction in a straight line for a while. 2. Then spiral outwards until hit something. 3. Try turning some random angle. If repeatedly hitting a wall, go into wall following mode for a while. Otherwise, go back to step 1. If you run this long enough to travel over 2x the actual floor area, the odds of achieving near full coverage are pretty good. Who needs navigation?