Autonomous Barrel Collecting
We decided to tackle the Eco-Disaster Challenge autonomously using a Raspberry Pi camera and the OpenCV library for image processing. First we calibrate for the different colours the colour needs to recognise. Next, the script initialises the robot's control interface, stops the robot, and sets the operational mode. Camera configuration is set up, including preview format and size. Main Loop: The main loop captures images from the camera and analyzes them to detect objects of interest based on calibrated colors. It alternates between searching for red/yellow and green/blue objects. It moves the robot towards the detected object and performs specific actions (like grabbing or placing) depending on the mode. Movement Control: move_towards: Moves the robot towards the detected object, adjusting its trajectory based on colour detection and distance. Colour Detection: The method begins by capturing an image from the camera using self.take_photo(picam). The image is processed to d...