Help me come up with a more clever way to detect opponents
November 6, 2012
I've built a minisumo-robot for a competition this saturday(http://www.robotchampion.se). It works quite ok, but I feel that my opponent detection is somewhat unoptimized.(Don't worry, I'll make a post with videos, pictures and such when the competition's over, no time for submissions right now, mah code needs optimizing!)
Right now I have two Sharp IR-sensors looking forward giving me a viewfield of about 120 degrees. I have an if-statement that turns left if the right sensor is closest and vice versa.
I feel that there's some clever mathematical solution to this though. Like making it turn more if the difference is bigger, I just don't know what sort of mathematical function I'm looking for, surely it must have a name right?
If you've done something similiar do share your math, I would be delighted to see how you solved it.