I haven't done much but plan on working on this Saturday night. Next step is to use actual distance measurements when doing the spin left and spin right commands. I just eyballed it by turning for some number of milliseconds until it looked like a 90deg turn.
Although it would make mapping tougher an idea I came up with is I could distance scan as the robot turns and find the longest path to drive straight.
But to keep things simple I plan on just using 90deg and 180deg turns.
Here is what I am thinking:
Maintain a 20x20 grid map with each grid representing 1sqft. This will be done by using 400 bytes of data to make it easy, it could be done in 100 bytes with each byte storing 4 values. Values are
1-explored and open
2-explored and occupied.
If the robot travels over 20ft in any direction it will turn around.
I will start the robot as if it was in the middle of the room. Memory may have to be shifted around as a new middle is found.
When the robot is done mapping It will beep a certain way, stop, and flash LEDs. At his point I can hook a serial cable to it, press a button, and upload the map to a PC. Finally, I will use the data to draw the map on the PC. Not sure how to do that yet.
If I can get it to work I will trying hooking an Arduino (with the same program) and sonar sensor to one of my reds. I then should have a mapping, cleaning robot.
This project could take a while but I will report back when I make progress.
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg