block avoidance code help

Thread Starter

abacusdheda

Joined Jul 23, 2010
2
Hi all,
i am participating in a competition where my autonomous bot have to differentiate between two types of block(essentially placed on the intersections of a grid) & deposit one of them at target position, avoiding contact with other type of block. sensors will take care of differentiating the blocks.
The problem is that if the bot follows scanning columnwise (or rowwise) & detect obstacle block in path, how should bot go about modifying the path dynamically. any standard algorithm which comes to help in such problems? elaborate explanation with pseudocode is most welcome.
 

retched

Joined Dec 5, 2009
5,207
You could use a flip-flop to change the direction of the scan from row-wise to column-wise at each trigger or contact.

You could also use a timer so if nothing was sensed in one setting for a given amount of time, it would trigger the flip-flop to start scanning the other setting.
 
Top