Skip to content

Latest commit

 

History

History
135 lines (116 loc) · 6.46 KB

getting_started_with_ros2_ov2.0.md

File metadata and controls

135 lines (116 loc) · 6.46 KB

ROS2_OpenVINO_Toolkit

NOTE: Below steps have been tested on Ubuntu 20.04 and Ubuntu 22.04. Supported ROS2 versions include foxy,galactic and humble.

1. Environment Setup

For ROS2 foxy and galactic on ubuntu 20.04:

For ROS2 humble on ubuntu 22.04:

2. Building and Installation

  • Install ROS2_OpenVINO_Toolkit packages
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/intel/ros2_openvino_toolkit -b ros2
git clone https://github.com/intel/ros2_object_msgs
git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-development
git clone https://github.com/ros-perception/vision_opencv.git -b <ROS2_VERSION>
  • Install dependencies
sudo apt-get install ros-<ROS2_VERSION>-diagnostic-updater
sudo apt install python3-colcon-common-extensions
  • Build package
source /opt/ros/<ROS2_VERSION>/setup.bash 
source <OpenVINO_INSTALL_DIR>/setupvars.sh
cd ~/catkin_ws
colcon build --symlink-install
source ./install/local_setup.bash

3. Running the Demo

Install OpenVINO 2022.3 by PIP

OMZ tools are provided for downloading and converting models of open_model_zoo in ov2022.
Refer to: OMZtool_guide

  • See all available models
omz_downloader --print_all
  • Download the optimized Intermediate Representation (IR) of model (execute once), for example:
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
omz_downloader --list download_model.lst -o /opt/openvino_toolkit/models/
  • If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to intermediate representation (such as the model for object detection):
cd ~/catkin_ws/src/ros2_openvino_toolkit/data/model_list
omz_converter --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert

Install OpenVINO 2022.3 by source code

  • See all available models
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --print_all
  • Download the optimized Intermediate Representation (IR) of models (execute once), for example:
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 downloader.py --list download_model.lst -o /opt/openvino_toolkit/models/
  • If the model (tensorflow, caffe, MXNet, ONNX, Kaldi) need to be converted to Intermediate Representation (such as the model for object detection):
cd ~/openvino/thirdparty/open_model_zoo/tools/model_tools
sudo python3 converter.py --list convert_model.lst -d /opt/openvino_toolkit/models/ -o /opt/openvino_toolkit/models/convert
  • Copy label files (execute once) Note:Need to make label_dirs if skip steps for set output_dirs above.
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/face_detection/face-detection-adas-0001.labels /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP32/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_segmentation/frozen_inference_graph.labels /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP16/
sudo cp ~/catkin_ws/src/ros2_openvino_toolkit/data/labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32
  • Check the parameter configuration in ros2_openvino_toolkit/sample/param/xxxx.yaml before lauching, make sure parameters such as model_path, label_path and input_path are set correctly. Please refer to the quick start document for yaml configuration guidance for detailed configuration guidance.
    • run face detection sample code input from StandardCamera.
    ros2 launch openvino_node pipeline_people.launch.py
    
    • run person reidentification sample code input from StandardCamera.
    ros2 launch openvino_node pipeline_reidentification.launch.py
    
    • run face detection sample code input from Image.
    ros2 launch openvino_node pipeline_image.launch.py
    
    • run object segmentation sample code input from RealSenseCameraTopic.
    ros2 launch openvino_node pipeline_segmentation.launch.py
    
    • run vehicle detection sample code input from StandardCamera.
    ros2 launch openvino_node pipeline_vehicle_detection.launch.py
    
    • run person attributes sample code input from StandardCamera.
    ros2 launch openvino_node pipeline_person_attributes.launch.py
    

More Information

Any security issue should be reported using process at https://01.org/security