Architecture
The structure of the robot
Software architecture
Structure
To build the robot three motors are deploied, two for the wheels and one for the grabber. At the same level as the wheels' motors there are placed the ultrasound sensor (placed as low as possible in order to let it detect obstacles and the ball), and the gyro sensor. Over this layer there is the motor of the grabber and the bearing structure. The Ev3 brick is placed at the back to counter balance the weight of the grabbing arm. The grabber is ingenious mechanism made of toothed wheels, gears, and extravagant lego pieces. This arm is able to go up and down, open and close the grabber using just one motor, pretty awesome! Morover on top of the grabber ther is the color sensor, that aims where the ball should be placed. This is useful to recognize if the ball has been found and it has been caught.
Initializing
All the motors and sensors used have been tested, and since some of them are not very reliable a statistical approach has been used to gather data. Motors are initialized once as soon as the robot is turned on.
Sensors
The sensors we deployed are the gyro sensor, the color sensor and the ultrasound sensor. These sensors have built-in functions that can be exploited to read data from them. Using these sensor it was clear that the unit measure where arbitrary, therefore to find threshold values it was necessary a trial and error approach. Also because the data reported were a bit imprecise in some cases, a statistical approach should be used.