How to plot a room outline from Ultrasonic Range Finder sensors

I have a toy car that has 4 sensors in front, rear and sides… they give me the distance to a wall if any exist within the range that the sensor covers, they give me this data in short intervals, but I don’t know much about plotting… maybe do it in opengl or something, but It seems like it’s going to have complex algorithms, I wonder if anyone has done this and can provide me some insight. Thanks in advance…

Knowing the distance to the object is only a small part of what you need to know to locate the object on a map. You need to know where you are, which way you are facing, and the angle from that direction to the object. The distance and the angle to it are easy.

How will you get the other two pieces of data?

SteveBash: I wonder if anyone has done this and can provide me some insight.

The problem is commonly known as simultaneous localisation and mapping (SLAM), and it's a tough problem to solve. Google will give you plenty of reading material on the subject.

It's not clear from the combination of your title and your first post whether you want to plot an outline of any room that the car happens to be in or if you just want to plot the outline of a room and the car is incidental and only being used because it has suitable sensors.

If you just want to plot the outline of a room I suspect it could be done by mounting an ultrasonic sensor on a servo (probably a sail-winch to give 360deg coverage) and taking readings every few degrees. There would still be some interesting maths and the outline would obviously be relative to the position about which the sensor rotates.

...R