*****Update 2.16.10*****
Got some data to start thinking about, guys. My thoughts of getting nice, even packs of 4 or 5 is a little out the window. To be honest, I tried to forget that I could see where the robot was facing and tried to make a decision where to go based on just the readings. I couldn't . Please note that I was seeing the readings on a LCD so left was above right not in a straight line. --Now that I think of it, I have no idea why I didn't line them up as it is a 16x2 display. Huh.
All readings were taken L to R
Now, here's what I did, I added some scraps of drywall that I had around the kitchen table's base. I didn't want any sensor holes, just smooth walls just to keep this as basic as I could. So here we go, the data is under each photo and the 3 readings were at 1000, 750 and 500.
@1000
L = 00000000
R = 11100000
@750
L = 00000111
R = 11110000
@500
L = 00011111
R = 11111111
@1000
L = 00000000
R = 00000000
@750
L = 00000000
R = 00000111
@500
L = 11111000
R = 00001111
@1000
L = 00000000
R = 01111001
@750
L = 00000000
R = 11111101
@500
L = 10000001
R = 11111101
@1000
L = 00000000
R = 11000000
@750
L = 00000000
R = 11000011
@500
L = 00001111
R = 11111110
****Original Post*****
Need some brainstorming here, folks...
Walter is just friggin big and because of his size, he needs some "side checks" i.e. one sonar is just not enough to keep an eye on his total width. In the past, I have used one center-mounted sonar with one sharp on each side. The sonar was in charge while the sharps would catch the walls. Basically, the sharps would catch a wall if Walter was coming up on that wall at a shallow angle or was traveling allong a wall (not actually following it). This system worked well (except for the God-awful elec. noise from the sharps) with the sonar being a code priority and the sharps "knew their place" in terms of when they could tell the code to change course.
Now:
I have 2 sonars, one each on each of the front two corners. Each sonar can pivot from almost 90 degrees to the side to slightly past center (i.e. the left sensor can see straight out to the left side and, when fwd, can see slightly past the centerline --a little to the right)
Question:
I need some brainstorming here. I have tried about 9 different versions of navigation code with different levels of success and a lot of failures. I have tried:
If one side is closer than the other, the closer is priority -listen to that sensor.
If one sensor is looking to the side, let it skootch off the wall and the fwd sensor is the priority for obsticle avoid.
If one side sees something, let a bit=1 (to remember something WAS there) and then figure that in as to what the other side is seeing.
Average all numbers on one side and compare to the average of all numbers on the other side.
Find a wall, keep that side's sensor fixed on the wall and sweep the other side's sensor for obsticles
Simple avoid whatever either sensor sees no matter what unless both are triggered. Then stop, scan R to L, find the furthest distance, turn to that heading, rescan to see if there is a wide enough path for the bot to fit, turn to the middle of this "path" and go.
etc. etc. etc. etc. etc.
I'm looking for BIG ideas here, folks. No code, just a 30,000' view of the problem. Brainstorm, brainstorm, brainstorm...
****Update*****
I think I got it, guys... Check my work, would ya?
We have this:
Breaks down like this. 3 distance rings with 8 segments each left and right. Each point on the arc gets a bit --6 bytes total, 48 bits total. The danger limit is proportionate to the servo posistion so as the sonar swings more to the side the danger limit is decreased and as it swings to the fwd posistion, it is increased. At each point, if the range is > danger that bit turns into a one.
Reading the data:
Find the start and end of each "pack" of ones. Each pack of ones is then checked for width. Each pack of ones that makes the cut must be wide enough for the bot to get through and also should be able to be narrower if it is farther out. From there, I have all the available paths I could use. Choosing a path could be anything -for instance, widest pack that is farthest out wins -or- lets say I am in my docking mode... I have found the beacon, is there a path wide enough in that direction to travel that way? Or maybe I get one of those pyro-thingies that detect body heat... Same thing: There is a human and I should follow it, is the direction of the sensor within one of the "paths" available. Etc. Etc.