Skip to content

Latest commit

 

History

History
163 lines (107 loc) · 4.43 KB

README.md

File metadata and controls

163 lines (107 loc) · 4.43 KB

Yolo v6 Object Detection from UAV Images

This repository contains a ROS noetic package for YOLOv6 to recognize objects from UAV and provide their positions. Based on ROS Package for Yolov6 developed by @lukazso This package works together with MRS System, it is a easy to simulate UAV.

Build Status

Component 20.04
RMA image

Features

  • UAV
  • Bluefox or Real-sense D-435
  • Odometry

Dependencies and Requirements

Step 1 - Instal MRS System

Follow the instructions here (on Installation topic) to install MRS System or use the commands:

cd /tmp
echo '
GIT_PATH=~/git
mkdir -p $GIT_PATH
cd $GIT_PATH
sudo apt-get -y install git
git clone https://github.com/ctu-mrs/mrs_uav_system
cd mrs_uav_system
git checkout master
git pull
./install.sh -g $GIT_PATH
source ~/.bashrc' > clone.sh && source clone.sh

Step 2 - Environment

Clone this repository into your catkin workspace, and looking for the setup and install dependencies:

cd ~/Your_worspace/src 
git clone https://github.com/JorgelHenri/ocean_trash_world

Step 3 - Yolo

Following ROS packages are required:

sudo apt-get install ros-noetic-vision-msgs
roscd vision_msgs 
sudo apt-get install ros-noetic-geometry-msgs
roscd geometry_msgs  

Clone this repository into your catkin workspace:

cd ~/Your_worspace/src
git clone https://github.com/vivaldini/yolo-uav 

The Python requirements are listed in the requirements.txt. You can simply install them as

cd ~/Your_worspace/src/yolov6-uav
pip install -r requirements.txt 

Build the package

cd ~/Your_worspace/src/yolov6-uav
catkin build

Using the simulator and Testing the Yolo

  • Parameters configuration

In the file ~/Your_worspace/ocean_trash_world/offshore_uav_pack/start/session.yml, line 21 change the world environment "ballontrash.launch" to "trash.launch", and if necessary the camera.

In the file ~/Your_worspace/yolov6-uav/src/detect.py line 150, change it for your worspace and choose the weigths for your trainning models. For the garbage set as yolo_v6_simulated.pt

Before you launch the yolov6.launch node, adjust the camera and YOLOv6 weights topics in the launch file according to the sensors and topics that you are using.

  • Run the simulator

This scenario opens a sea area containing some garbage and spawn a UAV.

cd ~/Your_worspace/src/ocean_trash_world/offshore_uav_pack/start
$ ./start.sh

In the Gazebo to start the simulation press the button ***Play

  • Starting the Yolo

Copy the files of trainning available in this drive inside the folder "/yolov6-uav/launch/yolo_weigths"

roslaunch yolov6-uav yolov6.launch

Each time a new image is received it is then fed into YOLOv6.

***Notes

  • The detections are published using the vision_msgs/Detection2DArray message type.

  • The detections will be published under /yolov6/out_topic.

  • If you set the visualize parameter to true, the detections will be drawn into the image, which is then published under /yolov6/yolov6/visualization.

  • Move the UAV

In the terminal where you executed the environment, go to the "Status tab" and press

-- "h" to appear the command control of the UAV, and

-- "Shift + R" to operate the UAV manually.

Screenshot from 2023-03-30 14-16-59

***Note: Move the UAV to view the garbage.

  • Visualization
rqt_image_view
topic /yolo6/yolov6/visualization

Screenshot from 2023-03-30 13-53-28

Extra 1: Ways to stop the simulation

Press “CTRL + a” and after “k” in the prompt.

If something remains open:

alias killg='killall gzclient && killall gzserver && killall rosmaster'
killall px4
tmux kill-server

Support

For support send email vivaldini@ufscar.br and dpsoler@usp.br