Society of Robots - Robot Forum
Software => Software => Topic started by: arigid on September 30, 2011, 02:21:01 PM
-
Hello all, I Was just wondering on how to count the number of intersections(If any) while following a white line.
Well it was for a local competition, Please help, if you could suggest an Algorithm for the Same, Thanks!
-
Increment a variable by one each time?
More details are needed.....
-
Well theres a Grid of white line in the arena and the bot is supposed to follow a fixed path, so it thought of doing it by counting the intersections, I first thought of using a counter function but that was having some problems , Please help if you could, Thanks!
-
assuming you are working with an array of sensors , arranged in a straight line configuration like following
# # # # # # # #
(http://www.ikalogic.com/tutorials/line_sens_algo/intersections.jpg)
The picture shows some situations that might arise when you cross the junctions. now you can program your micro-controller to increment junction count variable when any of these situations arises. ( remember that these situations may or may not occur in your case, you must check it)
in this example, increment junction count when you get
- all high ( or low depending on your hardware implementation) from the sensors.
- high (or low for inverse configuration) on sensors 1,2,5,6
- high (or low for inverse configuration) on sensors 2,3,7,8
here is a good link about line following , go through it if you still have some doubts.http://www.ikalogic.com/tut_line_sens_algo.php (http://www.ikalogic.com/tut_line_sens_algo.php)