Object Recognition - P4B5/ros_course GitHub Wiki

For object recognition its convenient to use YOLO. YOLO is a convolutional neural network, which provides a great library abstraction to object/person detection.

1. First inspect NVIDIA GPU optimization for a better experience using YOLO. (if your PC has a NVIDIA GPU consider to install this driver if you don't darknet is going to work at ~1.5fps with CUDA will be around ~65fps, depends on the model of your GPU)

PRE INSTALLATION TOOL NVIDIA TOOL KIT

NVIDIA CUDA INSTALLATION

**warning: follow all the steps carefully prerequisites, installation and the post-installation requeriments

some relative problems with cura in compilation with catkin_make run in your lib directory:

sudo ln -s /usr/local/cuda/lib64/libcudart.so /usr/local/lib/

sudo ln -s /usr/local/cuda/lib64/libcurand.so /usr/local/lib/

You will have to install NVIDIA CUDA (software for development code for NVIDIA GPUs)

2. Install YOLO (You Only Looks Once):

  1. clone in your catkin_ws/src: git clone --recursive https://github.com/leggedrobotics/darknet_ros.git

  2. compile your ws: catkin_make.

3. Run darknetROS

roslaunch darknet_ros darknet_ros.launch

**normally darknetROS recognise automatically if you have installed CUDA and the parameters will be configurated by itself. in case of not auto-configuration revise darknetROS docuementation.

more info about darknetROS YOLO: YOLO GITHUB

CAMERA

install camera driver: sudo apt install ros-melodic-ucv-camera. this allows you to use all different kinds of cameras as well as the webcam camera of your laptop

*for launch the webcam camera: roslaunch uvc_camera camera_node.launch

edit [your catkin_ws]/src/darknet_ros/config/ros.yml -> addd in -> subscribers -> camera_reading -> topic field the correct topic for your camera, the most common topic for a normal rgb 2D image is: /camera/rgb/image_raw.

1- LAUNCHER FOR CAMERA AND LASER: roslaunch robots kobuki_hokuyo_xtion.launch (keep in mind that this launchers depends on the type of camera (in this case ASUS xtion) and the laser (in this case hokuyo))

2- LAUNCH DARKNET ROS: roslaunch darknet_ros darknet_ros.launch

**set permissions to USB port for laser scan: sudo chmod 777 /dev/ttyUSB[number_of_usb_laser_connected]