Source code for Sonar 180 degrees scan, with multiple echoes?

I am looking for code that will draw a picture (or at least extract x,y coordinates of objects) from a 180 degree sonar scan, using the SRf08. It detects 16 echoes. I have the code (I wrote it) to get x,y locations of objects with a polaroid sonar unit, but I don't know how to incorporate the detection of echoes beyond the first.

Rich

Reply to
Rich J.
Loading thread data ...

Hum, Iv NOT done this, but am working towards a similar goal.

Could you elaborate on what is meant by "the detection of echoes beyond the first?"

I read this to mean detecting and objects relative location as it changes through time.

Or,

Detecting and object that is "beyond" the first echo return. i.e. two objects, one behind the other, relative to the sonar unit of course. Can this even be done?

Here is my plan, perhaps it will help you.

I intend to create a 8 X 8 occupancy grid representing the 180 degs. of space in front of my sonar unit.

For each of the 8 sonar pulse along my 180 deg. Sweep:

Find the distance of the echo return (x)

Evaluate x and place in 1 of 8 appropriate ranges

Read my sweep location (y)

Mark x, y grid location as "occupied"

Backfill all grids BEYOND x (in y column) as "occupied"

Move to next sweep position

Sounds easy enough (lol.. implementing this will keep me up late for a few weeks!)

8x8 might seem a bit "course" but should be good enough for my obstacle avoidance scheme.

I had originally planned on running a flooding algorithm to determine my route, but I realized I simply need to choose the y column that has the furthest away unoccupied grid x location... Hey wait a second! Now that I have written it out, I realize I don't even need a grid. An array of 8 bytes corresponding to the 8 sonar pulse location on my 180 deg. sweep, with the values of each element being the distance to the echo return would achieve exactly the same thing. Ok, guess Im not ready for this.. lol

Hope my ramblings provides some help to some one.. oh well, it was good for me!

Thanks

Reply to
danscott

yeah. the sonar unit (srf08) will detect 16 echoes. So, the farther away the object is that the sonar bounced off, the farther out the echo. Problem is that the echos can come from a wide area in the direction the sonar is facing in. It seems you could make a program to take all 16 echos from a 180 degree scan....say take a sonar reading every 5 degrees. I guess I just need to do it and see how it looks on a graph.

yes, read above. You can detect echo's after the first with most sonar units, I think. You can do so with hacks out of polaroid cameras.

interesting stuff. I'll read it more closely later.

Rich

Reply to
Rich J.

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.