Recently, YOLOv5 (although there seems to be pros and cons) came out, so I decided to change from YOLOv3 to YOLOv4, which is a little outdated, but I could not find a setup article in the ROS (Robot Operating System) environment. I will summarize it as a memorandum.
This time, we confirmed the operation on Ubuntu 16.04 and Ubuntu 18.04. Details are below.
|OS||Ubuntu16.04.6 LTS||Ubuntu18.04.5 LTS|
|CPU||Intel Core i7-8700||Intel Core i5-6500|
|GPU||Geforce GTX 1080 Ti||Geforce GTX 960|
|ROS||Kinetic 1.12.14||Merodic 1.14.9|
This time, we will proceed on the premise that the above environment is in place.
Currently, evacuate the ** darknet_ros package ** under ** ~ / catkin_ws / src / **. Create a backup directory (YOLOv3 this time) in your home directory and move it there.
#Please execute line by line $ cd $ mkdir YOLOv3 $ cd ~/catkin_ws/src $ mv darknet_ros ~/YOLOv3
Next, clone the ** darknet_ros ** package for YOLO v4 by referring to the following.
YOLO V4 for darknet_ros
$ cd ~/catkin_ws/src $ git clone --recursive https://github.com/Tossy0423/darknet_ros.git $ cd .. $ catkin_make
If make passes, you're done.
This ** darknet_ros uses ** uvc_camera ** as the driver for the ** USB camera. In my case, I'm using ** usb_cam ** as a driver, so I had to change the camera node that darknet received when testing.
1 subscribers: 2 3 camera_reading: 4 topic: /camera/rgb/image_row 5 queue_size: 1
1 subscribers: 2 3 camera_reading: 4 topic: /usb_cam/image_row 5 queue_size: 1
I tried an operation test.
#Run on two terminals # darknet_ros node launch $ roslaunch darknet_ros yolov4.launch #Launch camera node $ roslaunch usb_cam usb_cam-test.launch
I was able to display it nicely. that's all.