The robot does obstacle avoidance until the camera sees and recognises a bottle, once a bottle is detected with the Python script running on the Raspberry Pi its position is forwarded to the Arduino board that hosts the main program in a state machine which passes to the next state: grab the bottle.
Once the bottle is grabbed the homing system is quite simple: it follows the direction towards the recycling area (corner of the map) using a compass and once it detects a wall (and not an obstacle) it follows it until it reaches the corner and releases the bottle. Repeat.
The initial plan was to use 2 IR sensors and the camera for obstacle detection, but the camera was too slow and ultimately the simulation showed that more IR sensors would be a simpler solution and work just as well, so we decided to use 4 IR sensors and use the camera only for bottle detection.
The compass sensor had a lot of trouble in its original position behind the camera, it turns out the metal bars in the floor of the building structure were influencing the compass values, mounting it higher up on a mast fixed that problem.
The full project report can be found here in pdf format: https://github.com/Nurgak/STI-competition/blob/master/Documents/Project%20report.pdf?raw=true