Author Topic: Need help with mapping  (Read 3136 times)

0 Members and 1 Guest are viewing this topic.

Offline parthikTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Need help with mapping
« on: January 27, 2008, 01:07:08 AM »
I am building a robot but now i am stuck at mapping part.

I will draw a map in paint or some other drawing software and use it as a map in Visual Basic.I will select my source and destination locations and appropriate path should be created.
I want Visual Basic to output a hex file which will be fed to the microcontroller .This file would be the road map.

Now i need a good mapping algorithm.I am using IR sensor's and steppermotor.
Plz help i am in great trouble  ???.

Offline neo01124

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Re: Need help with mapping
« Reply #1 on: January 27, 2008, 02:13:02 AM »
check out admin's wavefront algorithm u'll have to hack it for ur specific purpose

Offline benji

  • Supreme Robot
  • *****
  • Posts: 830
  • Helpful? 0
Re: Need help with mapping
« Reply #2 on: January 27, 2008, 06:37:38 AM »
from what ive understood is that you want to scan first then send the map to the pc to visual basic and then it would send a hex file back to the bot,,??
sending a hex file means that you are reprograming the microcontroller
,so that means you are reprograming your robot after you aquire the map,, it just doesnt make sense
, you better get mapping scans using your IR and then sending map to pc t,then pc would have the wavefront algorithm to command your bot to go to its destination,,
good ol' BeNNy

Offline parthikTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: Need help with mapping
« Reply #3 on: January 28, 2008, 08:42:07 PM »
i just want my robo to move around and avoid obstacles .Will add complexities later like scanning the area,etc.
first my robo shd b able to move from source to destination will a map drawn in paint...

but i am not able to apply the wavefront in VB.....cud u make it little more clear?

and how could i output a hex file using VB ?

is C compiler better at mapping? if yes then could u show me some sample mapping codes?
« Last Edit: January 28, 2008, 09:21:24 PM by parthik »

Offline benji

  • Supreme Robot
  • *****
  • Posts: 830
  • Helpful? 0
Re: Need help with mapping
« Reply #4 on: January 29, 2008, 10:11:42 AM »
i dont understand how are you going to tell the robot where the destination is if you dont have a map.....????
do you mean somtin like(go north 10 meters,then turn right, then walk another 3 meters) thats your way?

anyways , i dont have much experience in VB ,,but i think using a c compiler would be much easier since they provide a big collection of libraries
,, you can try codevisionAVR ,if you are using an avr micro.
about mapping codes i dont have any
but as a mapping algorith you can do the following:

1/ make a scan
2/send it to pc as a matrix
3/move bot
4/take another scan
5/send it to pc
and so on

your pc has to have the ability to handle these matrixes and arrange em to make the map, here is the hard part of programing
good ol' BeNNy

Offline neo01124

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Re: Need help with mapping
« Reply #5 on: January 29, 2008, 01:39:15 PM »
but i am not able to apply the wavefront in VB.....cud u make it little more clear?
what the wavefront algorithm does is
1)divide the floor into a square grid
2)lets say ur goal coordinates are (0,0) in this 2d world
3)it will assign a value of ,f=(absolute(x)+absolute(y)), to each of the square grids, where x and y are the x and y coordinates of that grid wrt origin(goal)
4)at each position of ur bot in the world u move ur bot into the neighboring grid with the lowest f value if it does not consist an obstacle or if it does then into the neighbouring grid with the second lowest f value and so on....
this ensures ur bot is moving along the shortest path to the goal and avoiding obstacles as well

this is a special case of the A* algorithm from game programming with g=0, check this out for more info and a different implementation
http://theory.stanford.edu/~amitp/GameProgramming/

i just want my robo to move around and avoid obstacles .Will add complexities later like scanning the area,etc.
first my robo shd b able to move from source to destination will a map drawn in paint...
I think the simplest thing that could be done to achieve this kind of a thing would be to have your robot speak serially(RS 232 or USB) to your computer
and hand over the sensor readings and other relevant data and then carry out the mapping, path finding, etc. on your computer and then send back the motor control signals back to your microcontroller, check out the UART tutorial by admin on the home page and my post on another site for connecting ur bot to computer using serial or parallel port
http://www.roboticsindia.com/modules.php?name=Forums&file=viewtopic&t=2826

and how could i output a hex file using VB ?
i dont really know of many visual basic compilers for microcontrollers and i guess u should also specify what microcontroller u are using so that we could help you out on that front
moreover using the above suggested method of talking to ur bot serially u'll only have to compile easy and small code for uC in some other compiler and rest of ur code can be in any language through which u can serially talk to your bot!!

finally my rant comes to an end
« Last Edit: January 29, 2008, 01:41:46 PM by neo01124 »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Need help with mapping
« Reply #6 on: February 16, 2008, 06:13:21 PM »
parthik, I don't think you understand how maps are stored in a robot.

check out my wavefront tutorial, it will give you a good example of how to store a map:
http://www.societyofrobots.com/programming_wavefront.shtml

 


Get Your Ad Here

data_list