Code for Robocup Soccer Open 2024 participating with Roborregos
📁 File Breakdown:
- ESP32: Organizes data exchange between the camera and Raspberry Pi Pico, prioritizing speed and data integrity.
- Main Logic: Handles core decision-making processes for the robot.
- Open MV: Contains algorithms for ball, goalpost, and line detection using computer vision.
⚽ Ball Detection: Leveraging a regression model and pixel mapping, we determine real-time ball distance and angle. Advanced image processing techniques like LAB values and multi-blob tracking enhance accuracy.
🥅 Goalpost Detection: Utilizing coordinate translation and cosine calculations, we precisely locate goalposts relative to the robot's position using color.
🛤️ Line Detection: Employing grayscale filtering and pixel counting, our algorithm identifies potential obstacles (lines) and navigates around them.
🎮 Robot Control: Integration of 2 PID controllers ensures stable performance:
- Omega PID: Maintains central orientation.
- Translational PID: Guides the robot towards the ball and goalpost.
- Kinematic Equations: Enable omnidirectional movement using 4 wheels.
ROBOCUP-SOCCER-OPEN-2024
├─ Goalkeeper
│ └─ ESP32
│ └─ Pico
├─ Libs
│ └─ Bno
│ └─ Imu
│ └─ Motor
│ └─ Motors
│ └─ Photo
│ └─ PID
│ └─ Serial
│ └─ Transmission
├─ Striker
│ └─ ESP32
│ └─ Pico
├─ Test
├─ Vision
├─ .gitignore
├─ constants.h
└─ requirements.txt
Make sure to install the OpenMV IDE to upload the Vision files to the camera and to add the corresponding Arduino packages/libraries in your folder environment
Make sure to install the corresponding boards in your Arduino environment following the instructions.
- Open Preferences using the menu bar:
- Windows/Linux: File > Preferences
- macOS: Arduino IDE > Preferences
- Find the Additional boards manager URLs setting toward the bottom.
- Click the button to the right of the text field to open the Additional Boards Manager URLs window.
- Paste or remove URLs in the window. There should be one URL for each line.
- Click OK to close the Additional Boards Manager URLs window.
Board packages can be found here:
To install python dependencies paste the following command in your cmd environment
pip install -r requirements.txt
optimizations