# coordinates

 Tweet
3 replies [Last post]
aamiraarfi
Offline
Last seen: 4 years 36 weeks ago
Joined: 2009-11-02
bOt Points: 457

I'm assuming that there is a black and white grid, you know how to  work with IR sensor and you are also tracking the relative motion of the bot i.e.  in which direction your bot is moving.

Now Once you put you bot in the arena or black  and white grid or rather matrix track.. the bot should know in which matrix position it has to start with. The idea is to create a 2d array where we are going to put the values like first we will initialize all array values to zero(0) , one (1) for the current matrix cell. As i said we are going to keep track of the motion of the bot, so when the bot already crosses or traverses a particular cell we will change its value to, say 2...

0-cell not yet checked

1-current cell (bot position)

2-cell checked

use other values to locate your object etc or use 3d array to make your program better..

So now we can write complete algorithm to track the coordinate of the robot with 2d array (x,y) acting as co-ordinate position and now we have the whole image of the trajectory of the bot...

Note: Place your IR intelligently so that when bot changes its grid say from black to white it should be also able to track its  direction also.

Njoy robotics!

hitesh.kalsi1
Offline
Last seen: 10 years 7 weeks ago
Joined: 2009-10-06
bOt Points: 62

i am not getting the logic that how my bot will remeber the coodinates   that my bot will traverse.

i am working on my bot using 8051....

aamiraarfi
Offline
Last seen: 4 years 36 weeks ago
Joined: 2009-11-02
bOt Points: 457
@hitesh

hi hitesh!

i hope you know how to write codes in c language right ( or assembly )

It is important to know whatever i have written above is for a predefined chess board like track and its just the basic idea....

Let me make it simple for you .. Think of a track like matrix.. and co-relate it with an array..or array of memory locations..so we are actually playing with the values of the every matrix cells or arrays or memory locations.. recall pacman video game which we used to play when we were kids or google it..so when bot is inside any cell or a coordinate position or array location/ leaves the cell.. we change the value of the unexplored or explored cells

0-unexplored cells: initialized or initially we set it to zero

1-bot location or position: when the bot enters a cell location

2-explored cells:when bot has left the cell..so that bot should know it has to explore the unexplored cells only..

but if the track doesn't have a predefined path like chess board or the bot has to explore or solve a maze then you need to think of better method..