Help- I need help building an algorithm

Biggerhammer

Golden Member
Jan 16, 2003
1,531
0
0
I'm planning a project- a robot. Right now, the primary sensor will be an ultrasonic rangefinder mounted on a rotating platform. So, with one full revolution, the robot will have 36 measurements telling it how far the nearest obstacle is in that direction.

Now, the fun part. How can I use that to create a map? Some relatievely simple A* work will let me navigate once I have created the map, but going from range measurements to a map is stumping me right now.

Thank you.
(should this be in Highly Technical? Or should I jsut move it to P&M? ;))
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Create a XY plot of the objects detected with the robot at the center of the plot.

Simple High School Trig;

Distance to object * Sin/Cos of rangefinder horizontal angle provides you the relative Y/X coordinate from the finder.

Say the distance is 100 meters at a hortizontal angle of 30 degrees

100 * sin(30) = Y coordinate
100 * cos(30) = X coordinate

Now you have your point ploted relative to your origin.