Repo for object detection/localization in ROS with Intel Realsense camera
- Follow the guide here to install ROS melodic
- paste this into the terminal to install catkin build tools :
sudo apt-get install python-catkin-tools
- Go to the Nvidia Website here and
download the
PyTorch v1.8.0
.whl file - extract the folder in the home directory and rename it to
torch
(so the compiler can find it) - after that the torch folder will be in your home directory (see below)
follow the other instructions made in the installation section by Nvidia :
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install Cython
pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl
After that torch should be installed
mkdir -p CATKIN_FS/src/
git clone https://github.com/Cedric-Perauer/object_detection-.git
mv object_detection-/* CATKIN_FS/src/
cd CATKIN_FS/
catkin build
TODO
6) Change the Line 65 in camera_node/src/yolov5.cpp to point to the .engine file location (replace user name with your username) :
engine_name = "/home/<user_name>/CATKIN_FS/src/camera_node/src/yolov5s.engine";
do a similar thing in the file camera_node/src/camera_node.cpp (line 23)
std::string paramsFilePath = "/home/<user_name>/CATKIN_FS/camera_node/src/params.txt";
cd CATKIN_FS/
catkin build
=> When the build is successful you can download the rosbag file using this link
go into the downloads directory where the .bag file is located and run it with :
rosbag play -l camera.bag
start the camera_node wit :
rosrun camera_node camera_node
then you should see an image window openig that looks like this :
- If you run into an issue regarding boost (python_boost) or opencv follow these steps :
sudo apt install libopencv-dev=3.2.0+dfsg-4ubuntu0.1
Commenting row 11 12 in the CMakeLists.txt in the folder vision_opencv/cv_bridge/
if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8")
# Debian Buster
#find_package(Boost REQUIRED python37)
#else()
# Ubuntu Focal
find_package(Boost REQUIRED python)
endif()
And adding 0 at the #define NUMPY_IMPORT_ARRAY_RETVAL in the file /usr/include/python2.7/numpy/__multiarray_api.h