

This is how we stop searching one area and check the next area. The robot continues to search one area until the counter has reached a high enough variable.

This shows how we determine how long we search one area. The randomness of this number is dependent on the information learned.(More on that later) This is done by putting a counter in our loop and when that counter reaches a certain number(Random Number) we then switch what area we searching. To make the searching less predictable we randomize how long we search an area. This system allows us to easily follow an opponent once they come within range of us. First the blind spot sensor is no longer triggered or the main sensor has been triggered and we are moving at the enemy. We will continue this until one of two conditions are met. If vulnerable spot isn't clear we then start turning towards the spot. This ensures that we are covering the side that is most vulnerable. So if the robot is turning clock wise we check the left ultrasonic sensor and if the robot is turning counter clock wise we check the right ultrasonic sensor. If there isn't anything there we then check the ultrasonic sensor of the area we are turning in. This is connected to the light sensor switch and ran only when that is clear.įirst we are going to check the the main ultrasonic sensor to see if there's something in front of us. Things get more complicated when we add the two other ultrasonic sensors If it doesn't we spin the robot to "Search' for something. In this picture we are checking behind us with the light sensor and if that's all good we check our ultrasonic sensor. When we decide if we need to search first we check out behind. The searching protocol is based on the same key switch but gets more complicated when we add the other sensors. This also gives us 200% more area being searched opposed one s Searching Since the sensors are positioned on either side of the robot we can easily follow the opponent when they withdraw from a attack or attack the robot. This shows how the 3 ultrasonic sensors are mounted. I will talk about this more when we look at the code. These sensors are on either side of the robot so it can tell which way the enemy is going. Things start to get more complicated when we bring in the other two ultrasonic sensors. This picture shows the main switch that controls searching vs attacking. When the main sensor is triggered the robot then moves forward in the direction of the censor. The whole robot will spin in a set direction until one of the 3 ultrasonic sensors detect something. The core mechanic for the AI to track its opponent is based on the ultrasonic sensor. The light sensor are to track the edge of the arena while the ultrasonic sensors are for tracking movement Core Mechanics For AI Tracking 3 ultrasonic sensors are mounted on the front and a light sensor is mounted on the back. The robot it self is based on the five minute bot ( ).
