✨ScratchMow✨ - the intelligent* lawn mower robot Click the green flag and watch ScratchMow mow the lawn in real time. If you are impatient, you can turn on turbo mode (shift-click the green flag).
* Not very. Lawn mower robots are usually marketed as being very intelligent, but how intelligent does a robot need to be to mow a lawn? I decided to make this project to test that. I based the robot on my own lawn mower robot. I have no idea what the actual algorithms are - I just studied its behavior and tried to recreate it. This is what I found out: ✿ Basic mowing logic is REALLY simple. Just by "bouncing" off the boundary wires at semi-random angles, the robot will mow most of the lawn quite quickly. Making the robot stay inside the boundary is very straightforward - just back away when you touch the boundary. No extra costumes needed. To demonstrate this, I made a remix where I removed all other functionality: https://scratch.mit.edu/projects/715654795/ However, actual lawn mower robots mow until they are on top of the boundary wire, and to make that work, I made three sensor costumes. First, the mid center sensor detects the boundary wire, then the mid left and mid right sensors detect the general angle at which the robot faces the wire, which is then used to determine which way to turn, and by how many degrees. ✿ Handling corners is a bit tricky. I had to add an extra sensor (front center) in order to prevent it from getting stuck. It still happens though. ✿ Making the robot follow the boundary wire is a bit tricky as well. To make it work, I added two more sensors (front left and right). ✿ Making the robot return to the charger is simple once it can follow the wire. Just let it follow the wire until it reaches the charger. ✿ Making the robot avoid random obstacles without getting stuck is really tricky. The robot can go around or just go away from obstacles, depending on whether it is following the wire or if it is just cutting the grass randomly, but it has a tendency to get stuck in the object when trying to avoid it. My actual lawn mower robot gets stuck a lot too, so I guess I'm not THAT far off... Maybe you can remix it and make it more intelligent :)