The Daily Click ::. Forums ::. Klik Coding Help ::. Implementing the bug algorithm.

Post Reply  Post Oekaki 

Posted By Message

Benny Lindberg

13th October, 2011 at 18:12:22 -

Hello! I'm trying to implement the bug algorithm for an a.i!

I got an agent with 270 degree sensors, and it's supposed to be able to navigate around a room to reach a goal.
For those of you who know the bug algorithm, it's supposed to follow walls and turn around corners.

I'm having problems with the follow wall part! I have designed it so that it keeps itself straight along the wall by turning right or left if the sensors closest to the walls are between a certain interval, but the problem arises when it reaches a corner, becaus the top left sensor will say that it's distance is higher than bottom left, and will thus begin to turn left to close the distance, at which point the sensor touches the wall again and says that it is lower than the bottom left, and it turns right to increase the distance, and it gets stuck there.

I don't know if this was enough information, any ideas?


Post Reply



Worth A Click