Shop OBEX P1 Docs P2 Docs Learn Events
Can i — Parallax Forums

Can i

nofearsotnofearsot Posts: 25
edited 2005-06-08 04:13 in BASIC Stamp
Can I build a 2d map with the Ir sensors of my robot?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.geocities.com/cdrombot

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-07 13:15
    Is it possible: yes
    Is it easy: no
  • nofearsotnofearsot Posts: 25
    edited 2005-06-07 14:43
    How I can?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.geocities.com/cdrombot
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-07 15:04
    Like I said the concept isn't simple, it would require a small book to cover all the topics, the first step you need to determine is are you using vector or raster coordinate system. The bot naturally is a vector based system (travel in X compass direction Y distance), but representation of a vector coordinate system is complex and very easy to end up with a map so complex that you cannot garner useful information without performing complex mathmatical translations (how do you encode the bot travelling 105 degrees 3 meters, followed by 78 degrees for .5 meters, followed by 285 degrees 2.25 meters, then know at some future position where in the vector map your bot is). Rasterized map is much more easy to store then derive useful information from, but population of the map is time consuming because the bot must travel each and every coordinate within its internal map to obtain a complete map.

    This is just the top 1% of the iceberg, there are many more issues lying underneath such as sensor error, servo drift, traveling in directions other than the 4 cardinal directions, keeping exact track of servo/wheel rotation, etc. This is an advanced topic than nearly every forum member contemplates, but I have not seen anyone actually implement this. A fellow student in college used this mapping technique to navigate thier HC11 based bot through a maze, but the maze imposed sufficient constraint of the variables involved to significantly reduce the complexity, a bot moving freely in any direction does not have these constraints (unless you through programming your bot choose to artificially constraint it's movement)

    And one final point, you will need to add external memory to contain the map data.

    Post Edited (Paul Baker) : 6/7/2005 3:14:03 PM GMT
  • nofearsotnofearsot Posts: 25
    edited 2005-06-07 15:21
    Now I am understanding how much dificult it 's. If i build a donkey station with a power supply can The robot, when the battary is running down, go to donkey station?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.geocities.com/cdrombot
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-07 16:19
    Yes and you do not need to use such a complex method to do that, you can actually get away with a single aggregate vector, this vector represents the direction and distance to the recharging station. Lets say your bot is charged and on the station, your bot travels southeast 10 meters (10m @ 135°), southwest 3 meters (3m @ 225°), then west 4 meters (4m @ 270°). Now suppose your bot needs to get back to the station, using vector mathmatics, decompose the vector coordinates into raster coordinates (first leg's east/west displacement is 10*cos(135) = 7.07 m, north/south displacement is 10*sin(135) = -7.07m (meaning 7.07 meters southward). Doing this we get:

    East/West····· North/South
    7.07 m········· -7.07 m·········· first leg
    -2.12 m········ -2.12 m·········· second leg
    -4.00 m········ 0 m················ third leg, now add them up

    0.95 m········· -9.19 m·········· is the distance from the charging station, to get back we travel the opposite direction:

    -0.95 m······· 9.19 m············ recomposing this into vector format we get: sqrt((-0.95)2·+ (9.19)2) at atan(-0.95/9.19) or 9.24 meters @ 354°, assuming there was no drift nor error in measurement, traveling that vector will get you back to the recharging station. Since you cannot assume that (especially when you consider you'll be accumulating hours worth of errors in real life) you'll probably use the vector to get you near the recharging station·and some other system (such as an IR beacon) to do the final distance.

    While I showed calculating all the data at once, you would actually·update the vector each time your bot changed direction so you would only maintain a single vector.


    Post Edited (Paul Baker) : 6/7/2005 4:23:02 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-07 16:40
    Perhaps you could put a beacon on your "donkey station" so that when your robot's power gets low it starts looking for it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • nofearsotnofearsot Posts: 25
    edited 2005-06-07 16:48
    Does anyones have a ready programam?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.geocities.com/cdrombot
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-07 16:50
    Hello,

    ·· There aren't usually any ready-made programs that work with everything.· You will most likely have to do a little research and learn how to integrate code from various sources to accomplish your goals.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-07 16:59
    I think to obtain a reliable system he'd have to incorporate both, depending on how complex the layout of the space the bot will be traveling in, it is possible that a bot relying on a random walk to search for a base station which is out of sight (im thinking a different room) that the bot will be caught up and unable to find the station before the batteries run out. Using the vector method can also result in the bot trying to get back to the station via a dead end (see below straight path from bot to station means traveling through a wall), but you can employ a deterministic method of backtracking to get the bot out of the corner it is in. A beacon that isn't visible would provide no information to the bot on how to get out of the position it finds itself in.



    ___________________________________
    |                                  |
    |     Station                      |
    |                                  |
    |                                  |
    |                     _____________|
    |                     |            |
    |                     |   Bot      |
    |                     |            |
    |                     |________    |
    |                                  |
    |                                  |
    |__________________________________|                                           
    
  • nofearsotnofearsot Posts: 25
    edited 2005-06-07 18:04
    Any way. that 's very dificult I thing. Can I do the robot, if the batteries are running out, use a solar cell?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.geocities.com/cdrombot
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-07 18:12
    Yes and no, if your bot is in direct sunlight you can use a solar cell to trickle charge your batteries, you cannot operate your bot straight off of solar, plus you'll need a circuit to hold your bot's stamp in a state of reset, otherwise your bot will burn the charge off your batteries faster than the solar cell can charge them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-08 04:13
    Any of these methods can be done individually, they each have thier strengths and weaknesses, that's why I suggested combining them. If your curious you can try each and determine which is best, the concept of a self charging robot is fairly advanced, but Ill try to assist you as best I can.
Sign In or Register to comment.