• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Help- I need help building an algorithm

Biggerhammer

Golden Member
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? 😉)
 
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.
 
Back
Top