Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi
i am working on a project which involve a small robot to find its way around a building (inside). This robot has a laser scanner and a compass attached.

i found a A* algo here: A* algorithm implementation in C#[^]

and i would like to utilize this algo. however, i first need to know how to map the floor of my building first so that the algo can be used. any help on how to layout the map of the building is appreciated.

update:

I have all the data point of the walls. i can plot all these point and they can as well generate me a map. however, i don't think its simple as that, right?

thanks
Posted
Updated 17-May-12 4:02am
v3
Comments
Sergey Alexandrovich Kryukov 16-May-12 14:29pm    
Short answer: you need to design it. What did you try?
--SA
aznftw 16-May-12 14:38pm    
i have tried without the algo. what i got working is basically the robot to use the laser scanner to have a feel of where the walls are, and use the compass to give it directions.

so with that, i don't have a pre-planed path for my robot. which, right now i want to use the A*.

is there a library for mapping, or any tools which i can use?
wizardzz 16-May-12 16:42pm    
I would contact the author of the project via the project's message board.
aznftw 17-May-12 9:23am    
this is actually a totally different problem than the algo itself tho. that is, i want to generate a map from on-board sensors.
aznftw 18-May-12 16:44pm    
"you basically have to build your map based on a starting point. Once the laser detects something you need to go into proximity search mode until you have located either a wall or obstacle and plot a way around it."

that is what i really want always tho. but i just dont know how to start doing this. i looked up some papers, and they mention about "occupancy grid mapping". i think this would adapt to me better for this purpose. is there a good tutorial or paper where i can follows up on this idea?

1 solution

You may have problems finding an algorithm that you want. For example, the algorithm you point out is used for finding the shortest path thru a known maze. Your problem is more in line with finding paths through an unknown space. You cannot incorporate a map as that limits your robot to only that specific map. Place it in an unknown environment, as any tester of your program would do, and you will fail.

You need to think from an unknown aspect instead of known. Picture through your robots' eyes sitting in a giant warehouse and all you see is blackness around you. Maybe in one direction there is a slight hint of 'something' but you don't know if it is a wall or obstacle.

First write your algorithm to move your robot forward and track the movement. You basically have to build your map based on a starting point. Once the laser detects something you need to go into proximity search mode until you have located either a wall or obstacle and plot a way around it.

You should eventually have an internal map with points indicating where you've located blocks:

..................
.                .
.    ...         .
.    . .         .
.    ...         .
.                .
..................


So the main point of your algorithm would be to determine what to do when an obstacle is hit. So you may do something consistant like 'turn right and proceed forward 1 unit, turn left and confirm the obstacle is still there' If not move forward. You also need to incorporate the secondary logic of what to do with your robot once you've determined you mapped the outer boundaries and returned to a starting point so that you start moving back and forth to map the middle of the room.

Write your pieces in simple routines. Like 'Find Wall' 'Move One Point' etc. and test linking these routines together until your robot is autonomously discovering an unknown location.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900