Yolo v5 Obstacle Detection

This project leverages YOLOv5 to detect obstacles, specifically boxes and humans, in an agricultural field, enabling a robot to navigate and avoid these obstacles efficiently. YOLOv5's advanced object detection capabilities offer several advantages for robotics and agricultural applications. Its real-time detection speed and high accuracy ensure that the robot can swiftly and reliably identify obstacles, which is crucial for maintaining safety and operational efficiency in dynamic environments.

Introduction


In this project first a simulation using Gazebo was implemented to test the capability of detecting and avoiding the obstacles, based on a Yolov5 ROS wrapper. 

Then a real outdoor test was designed according to limitation of the robot to detect the obstacles.


*Disclaimer: I didn't collected the dataset nor train the model

Method

YOLOv5 (You Only Look Once version 5) is a state-of-the-art object detection model that builds on the YOLO series' real-time detection capabilities. It offers several advantages, including improved accuracy and speed due to its optimized architecture. YOLOv5 benefits from features such as auto-learning bounding box anchors, enhanced feature pyramid networks, and advanced augmentation techniques. These improvements lead to higher precision and recall in detecting objects within images. Additionally, YOLOv5 is easy to implement and use, with a PyTorch-based framework that supports transfer learning, making it accessible for both research and practical applications.

Dataset example

Dataset example

Dataset example

For the simulation Gazebo Classic was used and a model of the agricultural was created and loaded into the environment. Also an actor walking was used. Using a RGBD camera plugin in gazebo the environment was captured and sent to the YOLOv5 model.

Gazebo

Rviz



For the real test several boxes were placed next to the robot, along with one person and the camera used was a Zed 2i. The robot moved in a straight line at constant speed in between the obstacles.

Results

In the simulation detection and avoidance was tested successfully as shown in the first 2 videos below. Meanwhile in the real test only detection was tested successfully, avoidance was not tested due to the limitations of the robot.

Gazebo

Rviz simulation

Real test