I've been doing some testing using a cheap sonar on top of a stepper, taking measurements of its surroundings. The sonar is of pretty low quality, but mostly detects an echo. I have a concept for an algorithm, and wanted to hear comments before building more than my current test harness.
The idea is to be able to build a rudimentary map of a room within ~1-2Kb of RAM, using overlapping circles identifying open area.
Doing a stationary round-the-circle scan of 30+ measure angles, the code keeps track of the closest echo distance, and also counts the number of readings that fall into predefined intervals, like under 50cm, between 50cm and 100cm, and so on.
The minimum echo distance is stored along with the estimated coordinates of the robot. The robot then moves to some point within that circle, and performs a new circle scan. If the radius of the new "free area" is so small that it fits inside the original circle, we know there is an obstacle that the previous scan failed to see, and we may choose to dispose of that reading.
I plan to use dual 12V steppers implementing a simple differential drive. For each movement the robot does, an inaccuracy factor is updated (increasing) ... unless we can identify having been there before. That's what those counters are for, creating simple numbers representing "scenery".
The elegance of this is that the algorithm does not bother with how sonar singals can bounce of surfaces at an angle, as long as we hopefully get an indication of the smallest unobstructed circular area. As we all know, the closest point on any plane is always at a 90 degree angle relative to that plane.
Has anybody tried something similar?
So far I've tried manually moving a test platform around at different locations, and letting it scan the area, but to really get somewhere I need to construct a somewhat accurate moving platform, which is a big undertaking, so any tips, please?
Oh and the robot will have bumper sensors also, possibly even an electronic magnetic compass. Only in revision 2 do I plan to fit it with deadly weapons and giving it a mind of its own.