block avoidance code help

Discussion in 'Programmer's Corner' started by abacusdheda, Aug 18, 2010.

  1. abacusdheda

    Thread Starter New Member

    Jul 23, 2010
    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.
  2. retched

    AAC Fanatic!

    Dec 5, 2009
    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.