Identify the position of the obstacles and other objects.

Given the grid of stadium and critical information like initial position of the robot and the balls located at a predefined location, we used this information to our advantage. The prominent missing information was however the obstacles which will be placed anywhere on the stadium and we lose a point if the robot touches them . Hence, the challenge was to locate the obstacle from a distance as far away as possible but still be precise in reporting the position of the detected entity. We take mathematical route here. The gyro gives us the angle of the robot at which the object is detected. The ultrasonic sensor gives us the distance at which the object is relative to the robot. Hence, we calculate the position of the object in the grid with the collective data above.

NAVIGATION
We created 2 different types of navigation during the course of the project namely;
● FollowPattern()
● gamePath()
FollowPattern
We employed the gyro and ultrasonic sensors in our approach. The robot moves a certain given distance, does a 360 deg turn to scan objects in its path. This seemed to be a viable approach but we faced difficulties as the robot would scan the fence and interpret it as a game object.
Hence, an alternative explained below was created:
GamePath
This was a simple Plan B approach and it was done with the intent of keeping things simple. We made use of the gyro and ultrasonic sensors. The game was split into paths. Each path had a task of completing a game task; find and kick
ball and find and identify object. We split the path into;
● traverseUp – where the robot would move north of the field and scan for objects in its
path.
● traverseLeft – where the robot would move west of its location for objects.
● traverseRight – where the robot would move east of its location for objects.
● traverseBall – where the robot’s intent is to locate a ball and kick.
The robot returns to its initial location (home) after each task, whether it was successful or not
and sets a flag to know whether to repeat the task in the future.
The challenge we faced in execution of this approach was navigating back home which was later rectified by using a backward movement function.

Design a site like this with WordPress.com
Get started