Digital map in A* search algorithm in Arduino I am building an Automated Guided Vehicle as my graduation project. I'm new to path-finding algorithms and I've only worked with small projects based on Arduino as of now.
I've chosen A* search after careful understanding of many other algorithms (Dijkstra's/D*, etc.) and using Arduino Uno (will switch to Due later) for the robot.

I've implemented the code for A* in C++ as well. 

But I've got stuck in its implementation in Arduino. I don't know how to create a digital map of the arena (I'm using a 4 sq.m area and using a 10X10 grid for it). I don't have any idea how to move the robot in that arena with the digital map (I reckon I'll need wheel encoders and an ultrasonic sensor mounted on a servo for orientation).

My main problem is creating a digital map of the arena and how to go about it.

I'm attaching a code for A* for reference and the grid used in it.

// Driver program to test above function 
int main() 
{ 
  //* Description of the Grid- 
   1--&gt; The cell is not blocked 
   0--&gt; The cell is blocked    *//
  int grid[ROW][COL] = 
  { 
    { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 }, 
    { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1 }, 
    { 1, 1, 1, 0, 1, 1, 0, 1, 0, 1 }, 
    { 0, 0, 1, 0, 1, 0, 0, 0, 0, 1 }, 
    { 1, 1, 1, 0, 1, 1, 1, 0, 1, 0 }, 
    { 1, 0, 1, 1, 1, 1, 0, 1, 0, 0 }, 
    { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 }, 
    { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 }, 
    { 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 } 
  }; 

  // Source is the left-most bottom-most corner 
  Pair src = make_pair(8, 0); 

  // Destination is the left-most top-most corner 
  Pair dest = make_pair(0, 0); 

  aStarSearch(grid, src, dest); 

  return(0); 
}
first off, you need 2D array to store map segments.
then you have to update them according to the real map.
you have to implement a few measures:


a series of sensors to qualify adjacent segments. e.g. walls/road. map edges are considered walls.
an array (list) of current adjacent segments. (just a 4 member array, containing the up/down/left/right location. this array stores the index of the mentioned segments in the main 2D array.)
a beacon or something like that at the goal position. you can evaluate the segments based on the distance from beacon. (the simplest method, cartesian distance). 
run a iteration of A* alg to find out which adjacent segment is suitable for next move.