Reputation:
I know about line follower mainly the grid solving robots i know the basics actually. Actually they have to trace the path of the grid in an arena and then reach back to starting point in a shortest distance. Here my doubt is regarding the line follower in this link I have attached.Advanced line follower robot for grid solving and maze solving
My doubt is what are the procedures to do it? They have mapped the path and used Dijkstra algorithm to solve the path. But how do they transfer the code(i.e) where it has to turn which direction it has to turn. how are they generating the what function should be passed? Please explain i need the procedure alone. am going to try it with python.
Upvotes: 0
Views: 1219
Reputation: 27575
From the comments we exchanged, I feel more confident to assume your actual question is this:
What data structure could be used to store the structure (geometry, topology) of the map into the robot's memory?
Well there should be many possible ways to do that. Basically, this is a connected graph where nodes sit on a rectangular grid. So, for a start, one could describe the nodes as a set of coordinate pairs:
// just an example, this is not the actual map
// it doesn't need to be variables, could be array of arrays, or dictionary
var A = (0,0);
var B = (1,0);
var C = (2,1);
var D = (4,2);
// etc.
Then, you could describe the edges as pairs of points:
var edges = [(A,B), (A,D), (B,C), ...];
With these, you surely could calculate a good path from a list of points, and also the location and direction of each node.
I'm not sure at all if this is the most efficient data structure, but it is already a start. You only need to know the location of each node, and the edges are defined simply by linking two nodes together.
Upvotes: 0