Skip to content

YOLOX ROS Raspbian_Humble_OpenVINO_NCS2_picamera_

Ar-Ray edited this page Jan 29, 2023 · 1 revision

1. ROS2 Humble installation

Don't install ros-humble-ros-perception.

wget -qO - https://s3.ap-northeast-1.wasabisys.com/rpi-raspbian-ros2/default.gpg | sudo apt-key add -
echo "deb https://s3.ap-northeast-1.wasabisys.com/rpi-raspbian-ros2 bullseye humble" | sudo tee /etc/apt/sources.list.d/ros2-bullseye.list

sudo apt update
sudo apt install ros-humble-desktop libcamera-dev

2. OpenVINO installation

wget https://s3.ap-northeast-1.wasabisys.com/download-raw/dpkg/openvino/debian/bullseye/openvino-2022-raspbian-bullseye-arm64-0.1.0-20221219.deb
sudo apt install ./openvino-2022-raspbian-bullseye-arm64-0.1.0-20221219.deb

3. Download YOLOX-ROS source code

mkdir -p cd ~/ws_ros2/src
cd ~/ws_ros2/src

git clone https://github.com/ros-perception/image_common.git -b ros2
git clone https://github.com/ros-perception/vision_opencv.git -b humble
git clone https://github.com/Ar-Ray-code/picamera_ros2
git clone https://gitlab.com/boldhearts/ros2_v4l2_camera.git -b humble

git clone https://github.com/Ar-Ray-code/YOLOX-ROS.git --recursive

4. Download YOLOX-Nano

cd ~/ws_ros2
./src/YOLOX-ROS/weights/onnx/download.bash yolox_nano

5. Build

cd ~/ws_ros2
source /opt/ros/humble/setup.bash
source /opt/intel/openvino_2022/setupvars.sh

colcon build --symlink-install \
    --packages-skip-up-to yolox_ros_py \
    --cmake-args -DYOLOX_USE_TENSORRT=OFF \
    -DYOLOX_USE_OPENVINO=ON \
    -DYOLOX_USE_ONNXRUNTIME=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_CXX_FLAGS="-march=armv8-a+crc \
    -mtune=cortex-a72 -O3"

Run YOLOX-ROS

ros2 launch yolox_ros_cpp yolox_openvino_ncs2_picamera.launch.py model_path:=src/YOLOX-ROS/weights/onnx/yolox_nano_480x640.onnx