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.
Component | 20.04 |
---|---|
RMA | ![]() |
Features
- UAV
- Bluefox or Real-sense D-435
- Odometry
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
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
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
- 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 totrue
, 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.
***Note: Move the UAV to view the garbage.
- Visualization
rqt_image_view
topic /yolo6/yolov6/visualization
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
For support send email vivaldini@ufscar.br and dpsoler@usp.br