we have programmed a mobile robot that can pick up trash in an outdoor and indoor environment, with obstacle avoidance. The competition outline was the following:
The objective was to pick up the trash item off the ground and place it inside the bin to get points. If in any case the robot hit an obstacle or a wall we lose points.
hardware:
hiwonder ArmPi robot
To achieve that we have used different approaches including the following:
- A trash-obstacle detection AI model.
- A path planning algorithm for a pre-defined space dimentions.
- Robot movement and actions plus connections using Rasberry Pi.
- a trash bin detection model (when the trash bin placement is unknown.
Explaining each part of the methodology 🗒️:
-
AI models:
For this project we had two main AI Models:
-
trash-obstacle detection: we collected 30k images from various places on the internet (GitHub, Kaggle, ImageCV, Google Images, RoboFlow, Stock Images) -we do not own any copyrights over the images- and we filtered and labeled them mannually into two classes (trash, obstacle) using the OpenLabeling annotation tool.
The trash class has the following object types: (plastic bottles, glass bottles, paper, plastic bags, plastic toys, balls, pens, books, boxes, plastic cups, paper cups, glass cups, plastic plates, paper plates, rubic cube, chips bags, snacks wrapers).
After that we trained the data using a YOLOv5s model from Ultralytics, we acheived 75mAP, and when tested on various objects in different settings it gave good results.
How to run ➡️
1. clone the yolov5 repo.
2. run therequirements.txt
file to install the dependencies.
3. get theweights
folder from this repo (either by cloning using git or downloading the repo) and place it in the same directory where the yolo repo is.
4. run the inferance:
python3 yolov5/detect.py --weights weights/best.pt --conf 0.25 --source imagePath.jpg --device cpu
NOTE: if you wanna take feed from the webcam just put 0 instead of the imagePath in the --source. -
Trash bin sign detection: We trained a 1k images dataset of two classes (trashSign, random) on a simple CNN classification model,just to know the trash bin by its destinctive sign which is anything similar to the one in the demonstration figure at the beginning of this file. In order to run this model run the inferance code with the chosen image for testing.
-
-
Path Planning Algorithms:
- Finding bin when the placement is unknown: C++ based algorithm for finding the optimal path to reach to the trash bin in the arena.
- navigation algorithm: TypeScript grid based algorithm that uses A* algorithm to find the optimal destination to reach the trash item.
It provides the coordination between all parts of the robot, and does all of the heavy calculations. Clone the repo and run
npm run build
command.
contributers:
ScraperWizard
Hiba Hassan
m7mdony
SaraMashal