From 6254ff77221abee195d81ac5d93a6deb0fac8633 Mon Sep 17 00:00:00 2001 From: Jayabalaji Date: Tue, 4 Mar 2025 10:00:37 +0100 Subject: [PATCH 01/14] --> Creating docker container for ROS2 Humble with OpenVINO 2025.2.0 --> Updated the docker file for ros2 humble and it can support OpenVINO 2023.3 LTS --> Jazzy support added, for that librealsense library building inside docker, code is compiling without any error --> ROS2 Jazzy docker - Refactoring of the dockerfile, add nano package --> Created the README document to build, setup and run the docker container Signed-off-by: Sathiyamoorthi, Jayabalaji --- docker/ros2_ov2025/ros2_jazzy/Dockerfile | 52 ++++++++ .../ros2_jazzy/docker_instructions.md | 113 ++++++++++++++++++ docker/ros2_ov202x/ros2_humble/Dockerfile | 10 +- .../ros2_humble/docker_instructions.md | 8 +- openvino_param_lib/CMakeLists.txt | 1 + sample/param/pipeline_image.yaml | 2 +- 6 files changed, 178 insertions(+), 8 deletions(-) create mode 100644 docker/ros2_ov2025/ros2_jazzy/Dockerfile create mode 100644 docker/ros2_ov2025/ros2_jazzy/docker_instructions.md diff --git a/docker/ros2_ov2025/ros2_jazzy/Dockerfile b/docker/ros2_ov2025/ros2_jazzy/Dockerfile new file mode 100644 index 00000000..73583334 --- /dev/null +++ b/docker/ros2_ov2025/ros2_jazzy/Dockerfile @@ -0,0 +1,52 @@ +# ROS 2 OpenVINO Toolkit Environment (master f1b1ca4d914186a1881b87f103be9c6e910c9d80) + +FROM osrf/ros:jazzy-desktop + +# Set non-interactive mode for APT +ENV DEBIAN_FRONTEND=noninteractive + +# setting proxy env --option +# If needed, enable the below ENV setting by correct proxies. +# ENV http_proxy=your_proxy +# ENV https_proxy=your_proxy + +# Maintainer information +LABEL maintainer="Jayabalaji Sathiyamoorthi " + +SHELL ["/bin/bash", "-c"] + +# Install dependencies, OpenVINO, and librealsense2 +RUN apt update && \ + apt install -y --no-install-recommends \ + curl wget gnupg2 lsb-release nano software-properties-common \ + apt-transport-https libyaml-cpp-dev ros-jazzy-libyaml-vendor \ + libssl-dev libusb-1.0-0-dev libudev-dev pkg-config \ + libgtk-3-dev git cmake build-essential nano && \ + # Add OpenVINO GPG key and repository + wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /etc/apt/trusted.gpg.d/intel.gpg && \ + echo "deb https://apt.repos.intel.com/openvino ubuntu24 main" | tee /etc/apt/sources.list.d/intel-openvino.list && \ + apt update && \ + apt-get install -y openvino-2025.2.0 && \ + rm -rf /var/lib/apt/lists/* + +# Build librealsense2 +WORKDIR /root/ +RUN git clone --branch v2.55.1 --single-branch https://github.com/IntelRealSense/librealsense.git && \ + cd librealsense && \ + mkdir build && \ + cd build && \ + cmake ../ && \ + make uninstall && make clean && make -j7 && make install && \ + rm -rf /root/librealsense + +# build ros2 openvino toolkit +WORKDIR /root +RUN mkdir -p ros2_ws/src +WORKDIR /root/ros2_ws/src +RUN git clone https://github.com/intel/ros2_object_msgs.git +#change the branch before merge +RUN git clone -b ros2_jazzy https://github.com/jb-balaji/ros2_openvino_toolkit.git +RUN git clone -b humble https://github.com/ros-perception/vision_opencv.git +WORKDIR /root/ros2_ws +RUN source /opt/ros/jazzy/setup.bash \ + && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/docker/ros2_ov2025/ros2_jazzy/docker_instructions.md b/docker/ros2_ov2025/ros2_jazzy/docker_instructions.md new file mode 100644 index 00000000..300baf65 --- /dev/null +++ b/docker/ros2_ov2025/ros2_jazzy/docker_instructions.md @@ -0,0 +1,113 @@ +# ROS2 OpenVINO Toolkit Docker Image + +This repository contains a Dockerfile for building a Docker image with ROS2 and the OpenVINO toolkit. The image is based on the `osrf/ros:jazzy-desktop` base image and includes additional tools and libraries for working with OpenVINO and librealsense. + +## Features + +- ROS2 Jazzy Desktop +- OpenVINO Toolkit version 2025.2.0 +- librealsense2 +- User setup with `sudo` privileges + +## Prerequisites + +- Docker installed on your system +- Network connection & correct proxy settings for downloading base images and dependencies + +## Building the Docker Image + +To build the Docker image, use the following command. The default OpenVINO version is `2025.2.0`. + +```bash +docker build -t ros2_openvino_image . + +``` + +if you are behind a proxy server use the following command, + +```bash +docker build --build-arg "HTTP_PROXY=http://:" -t ros2_openvino_image . + +``` +## Download the Models from OpenVINO Model Zoo (OMZ) +OMZ tools are provided for downloading and converting OMZ models in OpenVINO 202x versions.
+Refer to: [OMZ-tool_guide](https://pypi.org/project/openvino-dev/) +Refer to: [OMZ Models](https://github.com/openvinotoolkit/open_model_zoo/tree/2024.6.0/models) + +```bash +omz_downloader --print_all +``` + +* Download the optimized Intermediate Representation (IR) of model (execute once), for example: + +```bash +omz_downloader --list /src/ros2_openvino_toolkit/data/model_list/download_model.lst -o /opt/openvino_toolkit/models/ +``` + +## Running the Docker Container + +To run the Docker container, use the following command: + +```bash +docker run -it --rm --name ros2_openvino_container ros2_openvino_image + +``` + +To run the Docker container with GUI support, use the following command: + +```bash +docker run -itd -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev:/dev --privileged=true --name ros2_openvino_container ros2_openvino_image + +``` + +To run the Docker container with the volumes containing models and images, use the following command: + +```bash +docker run -itd -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev:/dev -v /opt:/opt -v /data:/data --privileged=true --name ros2_openvino_container ros2_openvino_image +``` + +#### Explanation of Options + +* -itd: Combines three flags: + + -i: Runs the container in interactive mode, keeping the standard input open. + -t: Allocates a pseudo-TTY, which is useful for interactive applications. + -d: Runs the container in detached mode, allowing it to run in the background. + +* -e DISPLAY=$DISPLAY + + ###### Sets the DISPLAY environment variable inside the container to match the host's DISPLAY variable. This is necessary for GUI applications to display on the host's screen. + +* -v /tmp/.X11-unix:/tmp/.X11-unix + + ###### Mounts the X11 Unix socket from the host to the container. This is required for GUI applications to communicate with the X server on the host. + +* -v /dev:/dev + + ###### Mounts the /dev directory from the host to the container, allowing the container to access hardware devices. This is often necessary for applications that interact with hardware, such as cameras or GPUs. + +* -v /opt:/opt + + ###### Mounts the /opt directory from the host to the container, allowing the container to access the models installed from OpenVINO Model Zoo. + +* -v /data:/data + + ###### Mounts the /data directory from the host to the container, that contains the images and labels. Replace this with the folder of your images and labels. + +* --privileged=true + + ###### Grants the container extended privileges, allowing it to access all devices on the host and perform operations that are typically restricted. This is necessary for certain applications that require direct hardware access. + +* --name ros2_openvino_container + + ###### Assigns the name ros2_openvino_container to the running container, making it easier to reference in subsequent Docker commands. + +* ros2_openvino_image + + ###### Specifies the name of the Docker image to run. Replace this with the actual name of your built image if it differs. + +### Notes + +* Ensure that your host's X11 server is configured to allow connections from the Docker container. You may need to run xhost +local:docker on the host to permit this. + +* The --privileged flag provides the container with elevated permissions, which can pose security risks. Use it only when necessary and understand the implications. diff --git a/docker/ros2_ov202x/ros2_humble/Dockerfile b/docker/ros2_ov202x/ros2_humble/Dockerfile index ef622cfd..0a42c79c 100644 --- a/docker/ros2_ov202x/ros2_humble/Dockerfile +++ b/docker/ros2_ov202x/ros2_humble/Dockerfile @@ -15,8 +15,8 @@ LABEL maintainer="Jayabalaji Sathiyamoorthi /etc/apt/sources.list.d/intel-openvino.list; \ + else \ + echo "deb https://apt.repos.intel.com/openvino/${OPENVINO_MAJOR_VERSION} ubuntu22 main" > /etc/apt/sources.list.d/intel-openvino-${OPENVINO_MAJOR_VERSION}.list; \ + fi && \ apt update && \ apt-get install -y openvino-${OPENVINO_VERSION} && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/ros2_ov202x/ros2_humble/docker_instructions.md b/docker/ros2_ov202x/ros2_humble/docker_instructions.md index 9127a738..ed626c53 100644 --- a/docker/ros2_ov202x/ros2_humble/docker_instructions.md +++ b/docker/ros2_ov202x/ros2_humble/docker_instructions.md @@ -5,7 +5,7 @@ This repository contains a Dockerfile for building a Docker image with ROS2 and ## Features - ROS2 Humble Desktop -- OpenVINO Toolkit (version configurable supports 2025.0.0, 2024.x, 2023.3) +- OpenVINO Toolkit (version configurable supports 2025.x, 2024.x, 2023.3) - librealsense2 - User setup with `sudo` privileges @@ -16,14 +16,14 @@ This repository contains a Dockerfile for building a Docker image with ROS2 and ## Building the Docker Image -To build the Docker image, use the following command. You can specify the OpenVINO version using the `--build-arg` option. The default version is `2025.0.0`. +To build the Docker image, use the following command. You can specify the OpenVINO version using the `--build-arg` option. The default version is `2025.2.0`. ```bash -docker build --build-arg OPENVINO_VERSION=2025.0.0 -t ros2_openvino_image . +docker build --build-arg OPENVINO_VERSION=2025.2.0 -t ros2_openvino_image . ``` -Replace `2025.0.0` with the desired OPENVINO version if needed, for example to build `OpenVINO 2024.6`, use the following command, +Replace `2025.2.0` with the desired OPENVINO version if needed, for example to build `OpenVINO 2024.6`, use the following command, ```bash docker build --build-arg OPENVINO_VERSION=2024.6.0 -t ros2_openvino_image . diff --git a/openvino_param_lib/CMakeLists.txt b/openvino_param_lib/CMakeLists.txt index a7991962..52122484 100644 --- a/openvino_param_lib/CMakeLists.txt +++ b/openvino_param_lib/CMakeLists.txt @@ -28,6 +28,7 @@ add_library(${PROJECT_NAME} SHARED ament_target_dependencies(${PROJECT_NAME} "yaml_cpp_vendor" ) +target_link_libraries(${PROJECT_NAME} /usr/lib/x86_64-linux-gnu/libyaml-cpp.so) if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) diff --git a/sample/param/pipeline_image.yaml b/sample/param/pipeline_image.yaml index f41c3dc2..ccc39c73 100644 --- a/sample/param/pipeline_image.yaml +++ b/sample/param/pipeline_image.yaml @@ -1,7 +1,7 @@ Pipelines: - name: people inputs: [Image] - input_path: to/be/set/image_path + input_path: /home/skl/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg infers: - name: FaceDetection model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml From 8fbe49c2c377e60adb62c1f48f30aa447b782a64 Mon Sep 17 00:00:00 2001 From: Jayabalaji Date: Fri, 9 Jan 2026 16:43:48 +0100 Subject: [PATCH 02/14] [ROS2] [Jazzy] [NPU] Refactor pipeline configurations to use environment variables for model paths and labels (#12) * Refactor pipeline configurations to use environment variables for model paths and labels - Updated pipeline YAML files to replace hardcoded paths with environment variables ( and ) for better flexibility and portability. - Removed unnecessary output options in several pipelines to streamline the configuration. - Enhanced launch files for testing by adding launch arguments for YAML configuration paths, improving test setup and execution. - Ensured consistent labeling across various detection and segmentation models. * Code quality improvements: remove trailing whitespace, add Python cache to .gitignore, update README with new features * Remove unused RViz configuration launch argument from pipeline launch file --- .gitignore | 6 + README.md | 34 ++++ docker/ros2_ov2025/ros2_jazzy/Dockerfile | 2 +- openvino_param_lib/param/pipeline.yaml | 13 +- .../src/inferences/base_reidentification.cpp | 4 +- .../src/inputs/image_topic.cpp | 2 +- .../src/models/base_model.cpp | 2 +- .../src/outputs/ros_service_output.cpp | 2 +- .../src/outputs/ros_topic_output.cpp | 2 +- .../src/outputs/rviz_output.cpp | 2 +- openvino_wrapper_lib/src/pipeline_manager.cpp | 2 +- sample/CMakeLists.txt | 12 ++ .../pipeline_people.launch.cpython-38.pyc | Bin 1298 -> 0 bytes sample/launch/image_object_server.launch.py | 49 ++++- sample/launch/image_people_server.launch.py | 50 ++++- sample/launch/launch_helpers.py | 62 ++++++ .../launch/multi_pipeline_service.launch.py | 76 ++++++-- .../pipeline_composite_object_topic.launch.py | 135 ++++++++++--- .../pipeline_face_reidentification.launch.py | 136 +++++++++++-- sample/launch/pipeline_image.launch.py | 139 ++++++++++++-- sample/launch/pipeline_image_ci_test.py | 2 +- sample/launch/pipeline_object.launch.py | 124 ++++++++++-- sample/launch/pipeline_object_topic.launch.py | 143 +++++++++++--- sample/launch/pipeline_object_yolo.launch.py | 136 +++++++++++-- .../pipeline_object_yolo_topic.launch.py | 146 +++++++++++--- .../launch/pipeline_object_yolov5_ci_test.py | 2 +- .../launch/pipeline_object_yolov8_ci_test.py | 2 +- sample/launch/pipeline_people.launch.py | 134 +++++++++++-- sample/launch/pipeline_people_ci_test.py | 6 +- sample/launch/pipeline_people_ip.launch.py | 139 ++++++++++++-- .../pipeline_person_attributes.launch.py | 139 ++++++++++++-- .../pipeline_person_attributes_ci_test.py | 2 +- .../pipeline_reidentification.launch.py | 135 +++++++++++-- sample/launch/pipeline_segmentation.launch.py | 144 +++++++++++--- .../launch/pipeline_segmentation_ci_test.py | 2 +- .../pipeline_segmentation_image.launch.py | 142 +++++++++++--- .../pipeline_segmentation_image_ci_test.py | 2 +- .../pipeline_segmentation_instance.launch.py | 124 +++++++++--- .../pipeline_segmentation_instance_ci_test.py | 2 +- .../pipeline_segmentation_maskrcnn.launch.py | 145 +++++++++++--- .../pipeline_segmentation_maskrcnn_ci_test.py | 2 +- .../pipeline_vehicle_detection.launch.py | 134 +++++++++++-- .../pipeline_vehicle_detection_ci_test.py | 2 +- sample/launch/pipeline_video.launch.py | 181 +++++++++++++++--- sample/launch/ros2_openvino_oa.launch.py | 63 ++++-- sample/launch/rviz/default.rviz | 120 ------------ .../rviz/{default2.rviz => people.rviz} | 77 ++++---- sample/launch/rviz2.launch.py | 50 ++++- sample/param/image_object_server.yaml | 4 +- sample/param/image_people_server.yaml | 16 +- ...rvice.yaml => multi_pipeline_service.yaml} | 18 +- .../pipeline_composite_object_topic.yaml | 6 +- .../param/pipeline_face_reidentification.yaml | 20 +- sample/param/pipeline_image.yaml | 30 +-- sample/param/pipeline_image_ci.yaml | 20 +- sample/param/pipeline_image_video.yaml | 26 +-- sample/param/pipeline_object.yaml | 12 +- sample/param/pipeline_object_topic.yaml | 14 +- sample/param/pipeline_object_yolo.yaml | 18 +- sample/param/pipeline_object_yolo_topic.yaml | 14 +- sample/param/pipeline_object_yolov5_ci.yaml | 8 +- sample/param/pipeline_object_yolov8_ci.yaml | 8 +- sample/param/pipeline_people.yaml | 30 +-- sample/param/pipeline_people_ci.yaml | 20 +- sample/param/pipeline_people_ip.yaml | 26 +-- sample/param/pipeline_person_attributes.yaml | 14 +- .../param/pipeline_person_attributes_ci.yaml | 10 +- sample/param/pipeline_reidentification.yaml | 12 +- .../param/pipeline_reidentification_ci.yaml | 10 +- sample/param/pipeline_segmentation.yaml | 10 +- sample/param/pipeline_segmentation_ci.yaml | 8 +- sample/param/pipeline_segmentation_image.yaml | 14 +- .../param/pipeline_segmentation_image_ci.yaml | 6 +- .../param/pipeline_segmentation_instance.yaml | 18 +- ...e_segmentation_instance_yolov8_seg_ci.yaml | 10 +- .../param/pipeline_segmentation_maskrcnn.yaml | 10 +- .../pipeline_segmentation_maskrcnn_ci.yaml | 8 +- sample/param/pipeline_vehicle_detection.yaml | 20 +- .../param/pipeline_vehicle_detection_ci.yaml | 16 +- sample/param/pipeline_video.yaml | 16 +- .../pipeline_vehicle_detection_test.yaml | 2 +- tests/CMakeLists.txt | 3 + .../image_object_service_test.launch.py | 38 +++- .../image_people_service_test.launch.py | 38 +++- ...eline_face_reidentification_test.launch.py | 45 +++-- tests/launch/pipeline_face_test.launch.py | 42 +++- tests/launch/pipeline_image_test.launch.py | 42 +++- tests/launch/pipeline_object_test.launch.py | 41 +++- .../pipeline_reidentification_test.launch.py | 42 ++-- .../pipeline_segmentation_test.launch.py | 41 +++- .../pipeline_vehicle_detection_test.launch.py | 42 ++-- 91 files changed, 2914 insertions(+), 964 deletions(-) delete mode 100644 sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc create mode 100644 sample/launch/launch_helpers.py delete mode 100644 sample/launch/rviz/default.rviz rename sample/launch/rviz/{default2.rviz => people.rviz} (65%) rename sample/param/{multi_pipleine_service.yaml => multi_pipeline_service.yaml} (75%) diff --git a/.gitignore b/.gitignore index fdad95ad..d48f3830 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,9 @@ *.vscode microsoft.gpg *.swp +/install +/log +/build +__pycache__/ +*.pyc +*.pyo diff --git a/README.md b/README.md index cae874f4..ba5472e4 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ |Branch Name|ROS2 Version Supported|OpenVINO Version|OS Version| |-----------------------|-----------------------|--------------------------------|----------------------| +|[ros2_jazzy](https://github.com/intel/ros2_openvino_toolkit/tree/ros2_jazzy)|Jazzy|V2025.0, V2025.4|Ubuntu 24.04| |[ros2](https://github.com/intel/ros2_openvino_toolkit/tree/ros2)|Galactic, Foxy, Humble|V2022.1, V2022.2, V2022.3|Ubuntu 20.04, Ubuntu 22.04| |[dashing](https://github.com/intel/ros2_openvino_toolkit/tree/dashing)|Dashing|V2022.1, V2022.2, V2022.3|Ubuntu 18.04| |[foxy-ov2021.4](https://github.com/intel/ros2_openvino_toolkit/tree/foxy)|Foxy|V2021.4|Ubuntu 20.04| @@ -41,6 +42,7 @@ * [x] Person Re-Identification * [x] Vehicle Attribute Detection * [x] Vehicle License Plate Detection +* [x] **Intel NPU (Neural Processing Unit) Support** - Hardware acceleration for Intel Core Ultra processors # Prerequisite @@ -234,6 +236,38 @@ For the snapshot of demo results, refer to the following picture.

# Installation and Launching + +## New Features in ROS2 Jazzy Branch +This branch introduces several improvements for enhanced usability and maintainability: + +### 1. **Unified Path Management System** +All YAML configuration files now use environment variable placeholders for consistent path resolution: +- `` → System OpenVINO models directory (`/opt/openvino_toolkit`) +- `` → Package data directory for labels and images + +This makes configurations portable across different installations and environments. + +### 2. **Launch Helper Utilities** +New [launch_helpers.py](./sample/launch/launch_helpers.py) module provides automatic path resolution: +- Dynamically resolves placeholder paths at launch time +- Creates temporary resolved YAML files +- Simplifies launch file implementation + +### 3. **Intel NPU Support** +Native support for Intel Neural Processing Unit (NPU) acceleration: +- Available on Intel Core Ultra processors +- Set `engine: NPU` in YAML configuration files +- Optimized for low-power inference workloads +- Compatible with Intel optimized models (FP16) + +### 4. **Enhanced Visualization** +- Improved RViz2 integration with conditional launching +- Added timer delays for proper initialization +- Updated launch files with viewer arguments + +### 5. **Image Installation** +Sample images are now properly installed to the package share directory, enabling static image pipeline testing out-of-the-box. + ## Deploy in Local Environment * Refer to the quick start document for [getting_started_with_ros2](./doc/quick_start/getting_started_with_ros2_ov2.0.md) for detailed installation & launching instructions. * Refer to the quick start document for [yaml configuration guidance](./doc/quick_start/yaml_configuration_guide.md) for detailed configuration guidance. diff --git a/docker/ros2_ov2025/ros2_jazzy/Dockerfile b/docker/ros2_ov2025/ros2_jazzy/Dockerfile index 73583334..ffaf08eb 100644 --- a/docker/ros2_ov2025/ros2_jazzy/Dockerfile +++ b/docker/ros2_ov2025/ros2_jazzy/Dockerfile @@ -26,7 +26,7 @@ RUN apt update && \ wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /etc/apt/trusted.gpg.d/intel.gpg && \ echo "deb https://apt.repos.intel.com/openvino ubuntu24 main" | tee /etc/apt/sources.list.d/intel-openvino.list && \ apt update && \ - apt-get install -y openvino-2025.2.0 && \ + apt-get install -y openvino-2025.4.0 && \ rm -rf /var/lib/apt/lists/* # Build librealsense2 diff --git a/openvino_param_lib/param/pipeline.yaml b/openvino_param_lib/param/pipeline.yaml index 6e797cec..4b85fe76 100644 --- a/openvino_param_lib/param/pipeline.yaml +++ b/openvino_param_lib/param/pipeline.yaml @@ -41,20 +41,21 @@ Pipelines: - name: face_detection model: /opt/intel/computer_vision_sdk/deployment_tools/intel_models/face-detection-adas-0001/FP32/face-detection-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /opt/openvino_toolkit/data/labels/face_detection/face_detection-adas-0001.labels - name: age_gender_detection model: /opt/intel/computer_vision_sdk/deployment_tools/intel_models/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /opt/openvino_toolkit/data/labels/age_gender/age_gender-recognition-retail-0013.labels - name: emotion_detection model: /opt/intel/computer_vision_sdk/deployment_tools/intel_models/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: to/be/set/xxx.labels + label: /opt/openvino_toolkit/data/labels/emotion/emotions-recognition-retail-0003.labels - name: head_pose_detection model: /opt/intel/computer_vision_sdk/deployment_tools/intel_models/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels - outputs: [ImageWindow, RosTopic] + label: /opt/openvino_toolkit/data/labels/head_pose/head-pose-estimation-adas-0001.labels + #outputs: [ImageWindow, RosTopic] + outputs: [RosTopic, RViz] confidence_threshold: 0.2 connects: - left: StandardCamera @@ -74,5 +75,3 @@ Common: custom_cpu_library: okok enable_performance_count: true - - diff --git a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp index 0d0d7c3a..876bf67e 100644 --- a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp +++ b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp @@ -143,7 +143,7 @@ bool openvino_wrapper_lib::Tracker::saveTracksToFile(std::string filepath) outfile << "\n"; } outfile.close(); - slog::info << "sucessfully save tracks into file: " << filepath << slog::endl; + slog::info << "successfully save tracks into file: " << filepath << slog::endl; return true; } @@ -171,6 +171,6 @@ bool openvino_wrapper_lib::Tracker::loadTracksFromFile(std::string filepath) recorded_tracks_[track_id] = track; } infile.close(); - slog::info << "sucessfully load tracks from file: " << filepath << slog::endl; + slog::info << "successfully load tracks from file: " << filepath << slog::endl; return true; } diff --git a/openvino_wrapper_lib/src/inputs/image_topic.cpp b/openvino_wrapper_lib/src/inputs/image_topic.cpp index 0fe6a6ed..846996dc 100644 --- a/openvino_wrapper_lib/src/inputs/image_topic.cpp +++ b/openvino_wrapper_lib/src/inputs/image_topic.cpp @@ -17,7 +17,7 @@ * @file image_topic.cpp */ -#include +#include #include #include "openvino_wrapper_lib/inputs/image_topic.hpp" #include "openvino_wrapper_lib/slog.hpp" diff --git a/openvino_wrapper_lib/src/models/base_model.cpp b/openvino_wrapper_lib/src/models/base_model.cpp index d5b9e04d..3f6d6730 100644 --- a/openvino_wrapper_lib/src/models/base_model.cpp +++ b/openvino_wrapper_lib/src/models/base_model.cpp @@ -47,7 +47,7 @@ Models::BaseModel::BaseModel(const Params::ParamManager::InferenceRawData& confi void Models::BaseModel::modelInit() { - slog::info << "Loading network files" << model_loc_ << slog::endl; + slog::info << "Loading network files: " << model_loc_ << slog::endl; slog::info << label_loc_ << slog::endl; // Read network model diff --git a/openvino_wrapper_lib/src/outputs/ros_service_output.cpp b/openvino_wrapper_lib/src/outputs/ros_service_output.cpp index 9cb2e534..79c51106 100644 --- a/openvino_wrapper_lib/src/outputs/ros_service_output.cpp +++ b/openvino_wrapper_lib/src/outputs/ros_service_output.cpp @@ -21,7 +21,7 @@ #include #include #include "openvino_wrapper_lib/outputs/ros_service_output.hpp" -#include "cv_bridge/cv_bridge.h" +#include "cv_bridge/cv_bridge.hpp" void Outputs::RosServiceOutput::setServiceResponse(std::shared_ptr response) { diff --git a/openvino_wrapper_lib/src/outputs/ros_topic_output.cpp b/openvino_wrapper_lib/src/outputs/ros_topic_output.cpp index 043769f2..8a771397 100644 --- a/openvino_wrapper_lib/src/outputs/ros_topic_output.cpp +++ b/openvino_wrapper_lib/src/outputs/ros_topic_output.cpp @@ -23,7 +23,7 @@ #include "openvino_wrapper_lib/outputs/ros_topic_output.hpp" #include "openvino_wrapper_lib/pipeline_params.hpp" #include "openvino_wrapper_lib/pipeline.hpp" -#include "cv_bridge/cv_bridge.h" +#include "cv_bridge/cv_bridge.hpp" Outputs::RosTopicOutput::RosTopicOutput(std::string output_name, const rclcpp::Node::SharedPtr node) : BaseOutput(output_name) diff --git a/openvino_wrapper_lib/src/outputs/rviz_output.cpp b/openvino_wrapper_lib/src/outputs/rviz_output.cpp index 6e6b7b8e..539f305d 100644 --- a/openvino_wrapper_lib/src/outputs/rviz_output.cpp +++ b/openvino_wrapper_lib/src/outputs/rviz_output.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "cv_bridge/cv_bridge.h" +#include "cv_bridge/cv_bridge.hpp" #include "openvino_wrapper_lib/pipeline.hpp" #include "openvino_wrapper_lib/outputs/rviz_output.hpp" diff --git a/openvino_wrapper_lib/src/pipeline_manager.cpp b/openvino_wrapper_lib/src/pipeline_manager.cpp index 58a275ac..c2ba463f 100644 --- a/openvino_wrapper_lib/src/pipeline_manager.cpp +++ b/openvino_wrapper_lib/src/pipeline_manager.cpp @@ -127,7 +127,7 @@ PipelineManager::parseInputDevice(const PipelineData& pdata) { std::map> inputs; for (auto& name : pdata.params.inputs) { - slog::info << "Parsing InputDvice: " << name << slog::endl; + slog::info << "Parsing InputDevice: " << name << slog::endl; std::shared_ptr device = nullptr; if (name == kInputType_RealSenseCamera) { device = std::make_shared(); diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 8189f0a9..e2a660b4 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -283,6 +283,18 @@ install(DIRECTORY DESTINATION share/${PROJECT_NAME}/ ) +# Install data/labels files. +install(DIRECTORY + ../data/labels + DESTINATION share/${PROJECT_NAME}/data/ +) + +# Install data/images files. +install(DIRECTORY + ../data/images + DESTINATION share/${PROJECT_NAME}/data/ +) + if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) ament_lint_auto_find_test_dependencies() diff --git a/sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc b/sample/launch/__pycache__/pipeline_people.launch.cpython-38.pyc deleted file mode 100644 index 8848b7fbc32b86225ef1f6a330bb93e549db18af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1298 zcmZ`&KW`H;6hHg^C25*AEd!`SQv|~aHIXU?2857cL>)jZw^;7kxj5XNPqtHe}AH%8;K>>p=A95SB;Z=JZo@CzpjtKDaGQY53^ zkS4sxxZ#Nrvgpx*_0+Mb`df-8s%vt`j9n zi;>vKi)GWb1wDbShaikIM(?n389IZ+nfu;-bKT}KA8g2Y#vcdc5K0M7ofNTA=dnrCcP+<2k-e%K+<{}}-qL4(>yv%s*msHWbx>1Uf zXQJSw73yTM4Ay%J_H zM}%XD_!+hH7>YFVR0srC@G2c;Ijx!?qDGCSuDz0)QSFVTD3s;AazWIsIiUy)z7FZ^g@Nm# zWIV!gdqFT_xwq8p?H?S~h4`Ph{-x<0uU}5>vn;rxhLgn|Z21CjLae?I!a*H`|9E&V zF%A$$*!A$``hi>cySF{FI~WDOyl-k7;-Y3962fFch*|?Z-l4W(M8H^2NI5klS@ajZ y)$@XVaGO;fZ!N3tFN#(jduowqg -> /opt/openvino_toolkit (system OpenVINO models) + - -> Package share directory + /data (labels, images) + + Args: + yaml_filename: Name of the YAML file (e.g., 'pipeline_people.yaml') + package_name: ROS2 package name (default: 'openvino_node') + + Returns: + Path to the resolved YAML file (temporary file) + """ + # Get package share directory + package_share_dir = get_package_share_directory(package_name) + original_yaml = os.path.join(package_share_dir, 'param', yaml_filename) + + # Create a temporary directory for resolved YAML + temp_dir = tempfile.mkdtemp(prefix='openvino_') + resolved_yaml = os.path.join(temp_dir, yaml_filename) + + # Read and process the YAML file + with open(original_yaml, 'r') as f: + yaml_content = f.read() + + # Replace placeholders with actual paths + # Models use system OpenVINO installation + yaml_content = yaml_content.replace('', '/opt/openvino_toolkit') + # Data (labels, images) use package installation + yaml_content = yaml_content.replace('', os.path.join(package_share_dir, 'data')) + + # Write the resolved YAML + with open(resolved_yaml, 'w') as f: + f.write(yaml_content) + + return resolved_yaml diff --git a/sample/launch/multi_pipeline_service.launch.py b/sample/launch/multi_pipeline_service.launch.py index aacc6973..56215f57 100644 --- a/sample/launch/multi_pipeline_service.launch.py +++ b/sample/launch/multi_pipeline_service.launch.py @@ -12,25 +12,62 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Multi-Pipeline Service + +Launches multiple OpenVINO detection pipelines simultaneously. +Useful for running different models or configurations in parallel. + +This configuration runs two object detection pipelines with separate topics: +- Pipeline 1: /ros2_openvino_toolkit/detected_objects1 +- Pipeline 2: /ros2_openvino_toolkit/detected_objects2 + +Note: Requires sufficient compute resources (CPU/GPU) for multiple pipelines. +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - 'multi_pipleine_service.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default2.rviz') + """Generate launch description for multi-pipeline service with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('multi_pipeline_service.yaml') + + # RViz configuration for dual pipeline visualization + dual_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'default2.rviz') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for multi-pipeline service' + ), + + # OpenVINO multi-pipeline node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_multi_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object1/detected_objects', '/ros2_openvino_toolkit/detected_objects1'), @@ -39,10 +76,17 @@ def generate_launch_description(): ('/openvino_toolkit/object1/images', '/ros2_openvino_toolkit/image_rviz1'), ('/openvino_toolkit/object2/images', - '/ros2_openvino_toolkit/image_rviz2')], - output='screen'), - # Rviz - launch_ros.actions.Node( - package='rviz2', node_executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + '/ros2_openvino_toolkit/image_rviz2'), + ], + output='screen' + ), + + # RViz2 visualization with dual-view config + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', dual_rviz], + output='screen' + ), ]) diff --git a/sample/launch/pipeline_composite_object_topic.launch.py b/sample/launch/pipeline_composite_object_topic.launch.py index 767a28ed..e86c947d 100644 --- a/sample/launch/pipeline_composite_object_topic.launch.py +++ b/sample/launch/pipeline_composite_object_topic.launch.py @@ -1,37 +1,110 @@ -import launch +# Copyright 2018 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +ROS 2 Launch File: Composable Object Detection Pipeline + +Launches OpenVINO object detection pipeline using ROS 2 composable nodes +for zero-copy intra-process communication. This approach improves performance +by avoiding message serialization overhead. + +Composable nodes: +- RealSense camera node (optional, if available) +- OpenVINO composable pipeline + +Benefits: +- Reduced latency through intra-process communication +- Lower CPU overhead +- Better real-time performance + +Topics published: +- /ros2_openvino_toolkit/detected_objects +- /ros2_openvino_toolkit/image_rviz +""" + +import os +import sys + +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration from launch_ros.actions import ComposableNodeContainer from launch_ros.descriptions import ComposableNode -from ament_index_python.packages import get_package_share_directory -import os + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - 'pipeline_composite_object_topic.yaml') - container = ComposableNodeContainer( - node_name='vision_pipeline', - node_namespace='', - package='rclcpp_components', - executable='component_container', - composable_node_descriptions=[ - ComposableNode( - package='realsense_ros', - node_plugin='realsense::RealSenseNodeFactory', - node_name='realsense', - parameters=[get_package_share_directory('realsense_examples')+'/config/d435i.yaml'], - extra_arguments=[{'use_intra_process_comms':'true'}]), - ComposableNode( - package='openvino_node', - node_plugin='ComposablePipeline', - node_name='composable_pipeline', - parameters=[{"config":default_yaml}], - remappings=[ - ('/openvino_toolkit/object/detected_objects', - '/ros2_openvino_toolkit/detected_objects'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - extra_arguments=[{'use_intra_process_comms':'true'}] - ) + """Generate launch description for composable object detection pipeline.""" + + # Get package share directory + try: + realsense_config_dir = get_package_share_directory('realsense_examples') + realsense_config = os.path.join(realsense_config_dir, 'config', 'd435i.yaml') + except: + # Fallback if realsense_examples not installed + realsense_config = '' + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_composite_object_topic.yaml') + + return LaunchDescription([ + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the composable pipeline' + ), + + # Composable node container with OpenVINO pipeline + # Note: RealSense node is commented out - uncomment if using RealSense camera + ComposableNodeContainer( + name='vision_pipeline_container', + namespace='', + package='rclcpp_components', + executable='component_container', + composable_node_descriptions=[ + # Uncomment to include RealSense camera as composable node: + # ComposableNode( + # package='realsense_ros', + # plugin='realsense::RealSenseNodeFactory', + # name='realsense', + # parameters=[realsense_config] if realsense_config else [], + # extra_arguments=[{'use_intra_process_comms': True}] + # ), + + # OpenVINO composable pipeline node + ComposableNode( + package='openvino_node', + plugin='ComposablePipeline', + name='composable_pipeline', + parameters=[{'config': LaunchConfiguration('yaml_path')}], + remappings=[ + ('/openvino_toolkit/object/detected_objects', + '/ros2_openvino_toolkit/detected_objects'), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + extra_arguments=[{'use_intra_process_comms': True}] + ), ], output='screen', - ) - - return launch.LaunchDescription([container]) + ), + ]) diff --git a/sample/launch/pipeline_face_reidentification.launch.py b/sample/launch/pipeline_face_reidentification.launch.py index 5a2ceb51..1d2b0ae7 100644 --- a/sample/launch/pipeline_face_reidentification.launch.py +++ b/sample/launch/pipeline_face_reidentification.launch.py @@ -12,42 +12,136 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Face Re-identification Pipeline + +Launches the OpenVINO face re-identification pipeline with RViz2 visualization. +Detects faces with landmarks and assigns unique IDs to track the same person. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/detected_landmarks +- /ros2_openvino_toolkit/reidentified_faces +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_face_reidentification.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for face re-identification with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_face_reidentification.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_face_reidentification.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the face re-identification pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO face re-identification node + Node( package='openvino_node', executable='pipeline_with_params', - #arguments=['-config', default_yaml], + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/detected_landmarks', '/ros2_openvino_toolkit/detected_landmarks'), ('/openvino_toolkit/people/reidentified_faces', '/ros2_openvino_toolkit/reidentified_faces'), - ('/openvino_toolkit/people/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/people/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_image.launch.py b/sample/launch/pipeline_image.launch.py index 0ac9f013..9d43c401 100644 --- a/sample/launch/pipeline_image.launch.py +++ b/sample/launch/pipeline_image.launch.py @@ -12,29 +12,100 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: People Analytics Pipeline on Static Images + +Launches the OpenVINO people detection pipeline for processing static images. +Performs face detection with age/gender, emotion, and head pose estimation. + +This pipeline reads from image files (not live camera feed). + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/face_detection +- /ros2_openvino_toolkit/emotions_recognition +- /ros2_openvino_toolkit/headposes_estimation +- /ros2_openvino_toolkit/people/age_genders_Recognition +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_image.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for people analytics on images with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_image.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_image.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO image pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO people analytics node for images + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/faces', @@ -45,12 +116,40 @@ def generate_launch_description(): '/ros2_openvino_toolkit/headposes_estimation'), ('/openvino_toolkit/people/age_genders', '/ros2_openvino_toolkit/people/age_genders_Recognition'), - ('/openvino_toolkit/people/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/people/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_image_ci_test.py b/sample/launch/pipeline_image_ci_test.py index 644ccb76..9cefe3cd 100644 --- a/sample/launch/pipeline_image_ci_test.py +++ b/sample/launch/pipeline_image_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_image_ci.yaml')), # Openvino detection launch_ros.actions.Node( diff --git a/sample/launch/pipeline_object.launch.py b/sample/launch/pipeline_object.launch.py index 457faae1..b2f24684 100644 --- a/sample/launch/pipeline_object.launch.py +++ b/sample/launch/pipeline_object.launch.py @@ -12,35 +12,131 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Object Detection Pipeline with Optional Visualization + +Launches the OpenVINO object detection pipeline with optional visualization support. + +Visualization options: +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=rqt -> Launches rqt_image_view in standalone mode +- viewer:=none -> No visualization (default) + +Topics published: +- /ros2_openvino_toolkit/detected_objects: Detected objects +- /ros2_openvino_toolkit/image_rviz: Annotated image stream +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_object.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for object detection pipeline.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_object.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO pipeline' + ), + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + + # OpenVINO object detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), ('/openvino_toolkit/object/images', - '/ros2_openvino_toolkit/image_rviz')], - output='screen'), + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_object_topic.launch.py b/sample/launch/pipeline_object_topic.launch.py index 07de7471..2d1b0f02 100644 --- a/sample/launch/pipeline_object_topic.launch.py +++ b/sample/launch/pipeline_object_topic.launch.py @@ -12,43 +12,138 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Object Detection Pipeline with RViz2 + +Launches the OpenVINO object detection pipeline with RViz2 visualization. +This version subscribes to image topics (e.g., from RealSense camera). + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Note: This launch file does NOT start the camera node. Launch your camera + separately (e.g., realsense2_camera) before running this. + +Topics: +- Subscribes to: /camera/color/image_raw (or configured input) +- Publishes: /ros2_openvino_toolkit/detected_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_object_topic.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for object detection with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_object_topic.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object_topic.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + + # OpenVINO object detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_object_yolo.launch.py b/sample/launch/pipeline_object_yolo.launch.py index d5df63ac..4d97178e 100644 --- a/sample/launch/pipeline_object_yolo.launch.py +++ b/sample/launch/pipeline_object_yolo.launch.py @@ -12,40 +12,136 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: YOLO Object Detection Pipeline + +Launches the OpenVINO YOLO-based object detection pipeline with RViz2 visualization. +Supports various YOLO models (YOLOv5, YOLOv7, YOLOv8) converted to OpenVINO IR format. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/detected_objects +- /ros2_openvino_toolkit/image_rviz + +Note: Ensure your YOLO model is properly converted to OpenVINO format. + See tutorials in doc/quick_start/ for conversion instructions. +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_object_yolo.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for YOLO object detection with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_object_yolo.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object_yolo.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the YOLO pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO YOLO detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), ('/openvino_toolkit/object/images', - '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_object_yolo_topic.launch.py b/sample/launch/pipeline_object_yolo_topic.launch.py index 451f4b95..0271e561 100644 --- a/sample/launch/pipeline_object_yolo_topic.launch.py +++ b/sample/launch/pipeline_object_yolo_topic.launch.py @@ -12,44 +12,140 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: YOLO Object Detection Pipeline with RViz2 (Topic-based) + +Launches the OpenVINO YOLO-based object detection pipeline with RViz2 visualization. +Subscribes to camera image topics (e.g., from RealSense camera). + +Supports YOLOv5, YOLOv7, YOLOv8 models converted to OpenVINO IR format. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Note: Launch your camera node separately before running this pipeline. + +Topics: +- Subscribes to: /camera/color/image_raw +- Publishes: /ros2_openvino_toolkit/detected_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_object_yolo_topic.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for YOLO object detection with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_object_yolo_topic.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object_yolo_topic.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the YOLO pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO YOLO detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_object_yolov5_ci_test.py b/sample/launch/pipeline_object_yolov5_ci_test.py index cceaa362..60ba5cd6 100644 --- a/sample/launch/pipeline_object_yolov5_ci_test.py +++ b/sample/launch/pipeline_object_yolov5_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object_yolov5_ci.yaml')), # Openvino detection launch_ros.actions.Node( diff --git a/sample/launch/pipeline_object_yolov8_ci_test.py b/sample/launch/pipeline_object_yolov8_ci_test.py index 4d79a599..83e5c4b3 100644 --- a/sample/launch/pipeline_object_yolov8_ci_test.py +++ b/sample/launch/pipeline_object_yolov8_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_object_yolov8_ci.yaml')), # Openvino detection launch_ros.actions.Node( diff --git a/sample/launch/pipeline_people.launch.py b/sample/launch/pipeline_people.launch.py index 88386dcd..3f2c6c80 100644 --- a/sample/launch/pipeline_people.launch.py +++ b/sample/launch/pipeline_people.launch.py @@ -12,31 +12,94 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: People Analytics Pipeline with RViz2 + +Launches the OpenVINO people detection pipeline with multiple analytics: +- Face detection +- Age and gender estimation +- Emotion recognition +- Head pose estimation + +Topics published: +- /ros2_openvino_toolkit/face_detection +- /ros2_openvino_toolkit/emotions_recognition +- /ros2_openvino_toolkit/headposes_estimation +- /ros2_openvino_toolkit/age_genders_Recognition +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_people.yaml') + """Generate launch description for people analytics pipeline with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_people.yaml') + + # RViz configuration for people visualization + people_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_people.yaml')), - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO people pipeline' + ), + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=people_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + + # OpenVINO people analytics node + Node( + package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/detected_objects', @@ -47,12 +110,41 @@ def generate_launch_description(): '/ros2_openvino_toolkit/headposes_estimation'), ('/openvino_toolkit/people/age_genders', '/ros2_openvino_toolkit/age_genders_Recognition'), - ('/openvino_toolkit/people/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/people/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_people_ci_test.py b/sample/launch/pipeline_people_ci_test.py index e37d4e45..9a3bb81d 100644 --- a/sample/launch/pipeline_people_ci_test.py +++ b/sample/launch/pipeline_people_ci_test.py @@ -31,11 +31,11 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_people_ci.yaml')), # Openvino detection launch_ros.actions.Node( - package='openvino_node', + package='openvino_node', executable='pipeline_with_params', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ @@ -52,7 +52,7 @@ def generate_launch_description(): # Rviz #launch_ros.actions.Node( - #package='rviz2', + #package='rviz2', #executable='rviz2', output='screen', #arguments=['--display-config', default_rviz]), ]) diff --git a/sample/launch/pipeline_people_ip.launch.py b/sample/launch/pipeline_people_ip.launch.py index eb69a212..e69d3447 100644 --- a/sample/launch/pipeline_people_ip.launch.py +++ b/sample/launch/pipeline_people_ip.launch.py @@ -12,29 +12,100 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: People Analytics Pipeline (IP Camera Input) + +Launches the OpenVINO people detection pipeline optimized for IP camera input. +Performs face detection with age/gender, emotion, and head pose estimation. + +This variant is optimized for network camera streams. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/face_detection +- /ros2_openvino_toolkit/emotions_recognition +- /ros2_openvino_toolkit/headposes_estimation +- /ros2_openvino_toolkit/age_genders_Recognition +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_people_ip.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for people analytics with IP camera and RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_people_ip.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_people_ip.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the people analytics pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO people analytics node (IP camera optimized) + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/detected_objects', @@ -45,12 +116,40 @@ def generate_launch_description(): '/ros2_openvino_toolkit/headposes_estimation'), ('/openvino_toolkit/people/age_genders', '/ros2_openvino_toolkit/age_genders_Recognition'), - ('/openvino_toolkit/people/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/people/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_person_attributes.launch.py b/sample/launch/pipeline_person_attributes.launch.py index 10645ca2..5a28960a 100644 --- a/sample/launch/pipeline_person_attributes.launch.py +++ b/sample/launch/pipeline_person_attributes.launch.py @@ -12,40 +12,137 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Person Attributes Detection Pipeline + +Launches the OpenVINO person attributes detection pipeline with RViz2 visualization. +Detects persons and recognizes attributes such as clothing color, style, +accessories, etc. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/detected_objects +- /ros2_openvino_toolkit/person_attributes +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_person_attributes.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for person attributes detection with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_person_attributes.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_person_attributes.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the person attributes pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO person attributes detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), - ('/openvino_toolkit/object/person_attributes','/ros2_openvino_toolkit/person_attributes'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/object/person_attributes', + '/ros2_openvino_toolkit/person_attributes'), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_person_attributes_ci_test.py b/sample/launch/pipeline_person_attributes_ci_test.py index 75db6d5c..346743bb 100644 --- a/sample/launch/pipeline_person_attributes_ci_test.py +++ b/sample/launch/pipeline_person_attributes_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_person_attributes_ci.yaml')), # Openvino detection launch_ros.actions.Node( diff --git a/sample/launch/pipeline_reidentification.launch.py b/sample/launch/pipeline_reidentification.launch.py index defca5b3..76bcd9c6 100644 --- a/sample/launch/pipeline_reidentification.launch.py +++ b/sample/launch/pipeline_reidentification.launch.py @@ -12,41 +12,136 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Person Re-identification Pipeline + +Launches the OpenVINO person re-identification pipeline with RViz2 visualization. +Detects persons and assigns unique IDs to track the same person across frames. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/detected_objects +- /ros2_openvino_toolkit/reidentified_persons +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_reidentification.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for person re-identification with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_reidentification.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_reidentification.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO re-identification pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO person re-identification node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), ('/openvino_toolkit/object/reidentified_persons', '/ros2_openvino_toolkit/reidentified_persons'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_segmentation.launch.py b/sample/launch/pipeline_segmentation.launch.py index 9c599bf7..68f64fd7 100644 --- a/sample/launch/pipeline_segmentation.launch.py +++ b/sample/launch/pipeline_segmentation.launch.py @@ -12,44 +12,138 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Object Segmentation Pipeline with RViz2 + +Launches the OpenVINO semantic segmentation pipeline with RViz2 visualization. +Performs pixel-wise classification of objects in the scene. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Note: Launch your camera node (e.g., realsense2_camera) separately. + +Topics: +- Subscribes to: /camera/color/image_raw +- Publishes: /ros2_openvino_toolkit/segmented_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_segmentation.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for semantic segmentation with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_segmentation.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO segmentation pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO segmentation node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/segmentation/segmented_objects', '/ros2_openvino_toolkit/segmented_objects'), - ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/segmentation/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_segmentation_ci_test.py b/sample/launch/pipeline_segmentation_ci_test.py index d19ec20f..cc2c635b 100644 --- a/sample/launch/pipeline_segmentation_ci_test.py +++ b/sample/launch/pipeline_segmentation_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_ci.yaml')), # Realsense # NOTE: Split realsense_node launching from OpenVINO package, which diff --git a/sample/launch/pipeline_segmentation_image.launch.py b/sample/launch/pipeline_segmentation_image.launch.py index 88ac44a8..eb3154b9 100644 --- a/sample/launch/pipeline_segmentation_image.launch.py +++ b/sample/launch/pipeline_segmentation_image.launch.py @@ -12,44 +12,136 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Semantic Segmentation Pipeline on Static Images + +Launches the OpenVINO semantic segmentation pipeline for processing static images. +Performs pixel-wise classification (not real-time camera stream). + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics: +- Subscribes to: /camera/color/image_raw (or image file input) +- Publishes: /ros2_openvino_toolkit/segmented_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_segmentation_image.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for semantic segmentation on images with RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_segmentation_image.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_image.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the segmentation pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO semantic segmentation node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/segmentation/segmented_objects', '/ros2_openvino_toolkit/segmented_objects'), - ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/segmentation/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_segmentation_image_ci_test.py b/sample/launch/pipeline_segmentation_image_ci_test.py index d335e9f4..59891a2a 100644 --- a/sample/launch/pipeline_segmentation_image_ci_test.py +++ b/sample/launch/pipeline_segmentation_image_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_image_ci.yaml')), # Realsense # NOTE: Split realsense_node launching from OpenVINO package, which diff --git a/sample/launch/pipeline_segmentation_instance.launch.py b/sample/launch/pipeline_segmentation_instance.launch.py index 07821cc0..0bf610a1 100644 --- a/sample/launch/pipeline_segmentation_instance.launch.py +++ b/sample/launch/pipeline_segmentation_instance.launch.py @@ -12,44 +12,118 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Instance Segmentation Pipeline + +Launches the OpenVINO instance segmentation pipeline. +Performs object detection with pixel-perfect segmentation masks for each instance. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Note: Launch your camera node (e.g., realsense2_camera) separately. + RViz2 visualization is disabled by default for this pipeline. + +Topics: +- Subscribes to: /camera/color/image_raw +- Publishes: /ros2_openvino_toolkit/segmented_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_segmentation.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for instance segmentation.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_segmentation_instance.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_instance.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the instance segmentation pipeline' + ), + + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO instance segmentation node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/segmentation/segmented_objects', '/ros2_openvino_toolkit/segmented_objects'), - ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - #launch_ros.actions.Node( - # package='rviz2', - # executable='rviz2', output='screen', - # arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/segmentation/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + + # Note: RViz2 visualization commented out by default + # Uncomment to enable visualization: + # Node( + # package='rviz2', + # executable='rviz2', + # name='rviz2', + # arguments=['--display-config', ''], + # output='screen' + # ), ]) diff --git a/sample/launch/pipeline_segmentation_instance_ci_test.py b/sample/launch/pipeline_segmentation_instance_ci_test.py index bdebc6c4..e85f3a6f 100644 --- a/sample/launch/pipeline_segmentation_instance_ci_test.py +++ b/sample/launch/pipeline_segmentation_instance_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_instance_yolov8_seg_ci.yaml')), # Realsense # NOTE: Split realsense_node launching from OpenVINO package, which diff --git a/sample/launch/pipeline_segmentation_maskrcnn.launch.py b/sample/launch/pipeline_segmentation_maskrcnn.launch.py index a1c39ad7..ff8ec46f 100644 --- a/sample/launch/pipeline_segmentation_maskrcnn.launch.py +++ b/sample/launch/pipeline_segmentation_maskrcnn.launch.py @@ -12,44 +12,139 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Instance Segmentation Pipeline (Mask R-CNN) + +Launches the OpenVINO instance segmentation pipeline using Mask R-CNN. +Performs object detection with pixel-perfect segmentation masks. + + + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Note: Launch your camera node (e.g., realsense2_camera) separately. + RViz2 visualization is disabled by default for this pipeline. + +Topics: +- Subscribes to: /camera/color/image_raw +- Publishes: /ros2_openvino_toolkit/segmented_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_segmentation.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for Mask R-CNN instance segmentation.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_segmentation_maskrcnn.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_maskrcnn.yaml')), - # Realsense - # NOTE: Split realsense_node launching from OpenVINO package, which - # will be launched by RDK launching file or manually. - - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the Mask R-CNN pipeline' + ), + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + # OpenVINO Mask R-CNN instance segmentation node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/segmentation/segmented_objects', '/ros2_openvino_toolkit/segmented_objects'), - ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - #launch_ros.actions.Node( - # package='rviz2', - # executable='rviz2', output='screen', - # arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/segmentation/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + + # Launch rqt_image_view with delay if viewer is 'rqt' + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), + + # Launch RViz2 with delay if viewer is 'rviz2' + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['-d', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + ]) diff --git a/sample/launch/pipeline_segmentation_maskrcnn_ci_test.py b/sample/launch/pipeline_segmentation_maskrcnn_ci_test.py index 19c82525..e9c68836 100644 --- a/sample/launch/pipeline_segmentation_maskrcnn_ci_test.py +++ b/sample/launch/pipeline_segmentation_maskrcnn_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_segmentation_maskrcnn_ci.yaml')), # Realsense # NOTE: Split realsense_node launching from OpenVINO package, which diff --git a/sample/launch/pipeline_vehicle_detection.launch.py b/sample/launch/pipeline_vehicle_detection.launch.py index a147d95c..bf2f84bb 100644 --- a/sample/launch/pipeline_vehicle_detection.launch.py +++ b/sample/launch/pipeline_vehicle_detection.launch.py @@ -12,41 +12,135 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Vehicle Detection and Attributes Pipeline with Optional Visualization + +Launches the OpenVINO vehicle detection pipeline with license plate recognition +and vehicle attributes detection (color, type, etc.). + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode (default) +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/detected_license_plates +- /ros2_openvino_toolkit/detected_vehicles_attribs +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_vehicle_detection.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for vehicle detection pipeline.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_vehicle_detection.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_vehicle_detection.yaml')), - # Openvino detection - launch_ros.actions.Node( + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO vehicle detection pipeline' + ), + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rqt', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + + # OpenVINO vehicle detection node + Node( package='openvino_node', executable='pipeline_with_params', + name='openvino_pipeline', arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_license_plates', '/ros2_openvino_toolkit/detected_license_plates'), ('/openvino_toolkit/object/detected_vehicles_attribs', '/ros2_openvino_toolkit/detected_vehicles_attribs'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), + + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/pipeline_vehicle_detection_ci_test.py b/sample/launch/pipeline_vehicle_detection_ci_test.py index f4d72f15..5eb88428 100644 --- a/sample/launch/pipeline_vehicle_detection_ci_test.py +++ b/sample/launch/pipeline_vehicle_detection_ci_test.py @@ -29,7 +29,7 @@ def generate_launch_description(): default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', 'rviz/default.rviz') return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = + launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_vehicle_detection_ci.yaml')), # Openvino detection launch_ros.actions.Node( diff --git a/sample/launch/pipeline_video.launch.py b/sample/launch/pipeline_video.launch.py index 51eb8fdd..402697e3 100644 --- a/sample/launch/pipeline_video.launch.py +++ b/sample/launch/pipeline_video.launch.py @@ -12,39 +12,168 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: Video Segmentation Pipeline with Optional Visualization + +Launches the OpenVINO semantic segmentation pipeline for video files. +Reads video files and performs pixel-wise classification. + +Visualization options: +- viewer:=rqt -> Launches rqt_image_view in standalone mode +- viewer:=rviz2 -> Launches RViz2 with custom config +- viewer:=none -> No visualization + +Topics published: +- /ros2_openvino_toolkit/segmented_objects +- /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions - +from launch.actions import DeclareLaunchArgument, ExecuteProcess, TimerAction, OpaqueFunction +from launch.conditions import IfCondition from launch.substitutions import LaunchConfiguration, PythonExpression -import launch +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers + def generate_launch_description(): - #default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - #'pipeline_video.yaml') - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for video segmentation pipeline.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Resolve YAML configuration paths + # Note: video_path will be replaced after LaunchConfiguration is evaluated + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_video.yaml') + + # RViz configuration file + default_rviz = os.path.join(package_share_dir, 'launch', 'rviz', 'people.rviz') + + # Function to replace video path in YAML + def replace_video_path(context): + video_path_value = context.launch_configurations.get('video_path', '') + if video_path_value: + # Expand ~ to home directory + expanded_path = os.path.expanduser(video_path_value) + # Read the resolved YAML + with open(resolved_yaml, 'r') as f: + yaml_content = f.read() + # Replace the placeholder + yaml_content = yaml_content.replace('to/be/set/video_path', expanded_path) + # Write to a new temporary file + import tempfile + temp_fd, temp_path = tempfile.mkstemp(suffix='.yaml', prefix='pipeline_video_') + with os.fdopen(temp_fd, 'w') as f: + f.write(yaml_content) + return temp_path + return resolved_yaml + + from launch.substitutions import LaunchConfiguration + from launch.actions import OpaqueFunction + + def launch_openvino_node(context): + yaml_path = replace_video_path(context) + return [ + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_pipeline', + arguments=['-config', yaml_path], + remappings=[ + ('/openvino_toolkit/segmentation/segmented_objects', + '/ros2_openvino_toolkit/segmented_objects'), + ('/openvino_toolkit/segmentation/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ) + ] + return LaunchDescription([ - launch.actions.DeclareLaunchArgument(name='yaml_path', default_value = - os.path.join(get_package_share_directory('openvino_node'), 'param','pipeline_video.yaml')), - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', - executable='pipeline_with_params', - arguments=['-config', LaunchConfiguration('yaml_path')], - remappings=[ - ('/openvino_toolkit/segmentation/segmented_objects', - '/ros2_openvino_toolkit/segmented_objects'), - ('/openvino_toolkit/segmentation/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), - - # Rviz - launch_ros.actions.Node( - package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the video segmentation pipeline' + ), + + # Declare visualization viewer selection + DeclareLaunchArgument( + name='viewer', + default_value='rviz2', + description='Visualization viewer: "rviz2", "rqt", or "none"' + ), + + # Declare RViz config path + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz, + description='Path to RViz configuration file' + ), + + # Declare image topic for rqt + DeclareLaunchArgument( + name='image_topic', + default_value='/ros2_openvino_toolkit/image_rviz', + description='Image topic for rqt_image_view' + ), + + # Declare viewer startup delay + DeclareLaunchArgument( + name='viewer_delay', + default_value='2.0', + description='Delay before launching viewer (seconds)' + ), + + # Declare video file path + DeclareLaunchArgument( + name='video_path', + default_value='', + description='Path to video file for processing (required for Video input type)' + ), + + # Launch OpenVINO node with video path replacement + OpaqueFunction(function=launch_openvino_node), + + # RViz2 visualization (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen', + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rviz2'"]) + ) + ) + ] + ), + + # rqt_image_view (conditional) + TimerAction( + period=LaunchConfiguration('viewer_delay'), + actions=[ + ExecuteProcess( + cmd=['rqt', '--standalone', 'rqt_image_view', '--args', LaunchConfiguration('image_topic')], + output='screen', + shell=False, + condition=IfCondition( + PythonExpression(["'", LaunchConfiguration('viewer'), "' == 'rqt'"]) + ) + ) + ] + ), ]) diff --git a/sample/launch/ros2_openvino_oa.launch.py b/sample/launch/ros2_openvino_oa.launch.py index b759e165..1460ff47 100644 --- a/sample/launch/ros2_openvino_oa.launch.py +++ b/sample/launch/ros2_openvino_oa.launch.py @@ -12,27 +12,68 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Launch File: OpenVINO Object Analytics (Topic-based) + +Launches the OpenVINO object detection pipeline for integration with +OpenVINO Object Analytics (OA) framework. + +This is a lightweight launcher without visualization, suitable for +integration with other ROS 2 nodes or analytics pipelines. + +Note: Launch your camera node (e.g., realsense2_camera) separately. + +Topics: +- Subscribes to: /camera/color/image_raw +- Publishes: /ros2_openvino_toolkit/detected_objects +- Publishes: /ros2_openvino_toolkit/image_rviz +""" import os +import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node + +# Add the launch directory to Python path to import helper +launch_dir = os.path.dirname(os.path.abspath(__file__)) +if launch_dir not in sys.path: + sys.path.insert(0, launch_dir) + +import launch_helpers def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_node'), 'param', - 'pipeline_object_topic.yaml') + """Generate launch description for OpenVINO Object Analytics.""" + + # Resolve YAML configuration paths + resolved_yaml = launch_helpers.resolve_yaml_paths('pipeline_object_topic.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=resolved_yaml, + description='Path to YAML configuration file for the OpenVINO OA pipeline' + ), + + # OpenVINO object detection node (for Object Analytics) + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/image_raw', '/camera/color/image_raw'), + ('/openvino_toolkit/image_raw', + '/camera/color/image_raw'), ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), - ('/openvino_toolkit/object/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), + ('/openvino_toolkit/object/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), ]) diff --git a/sample/launch/rviz/default.rviz b/sample/launch/rviz/default.rviz deleted file mode 100644 index e0e241bb..00000000 --- a/sample/launch/rviz/default.rviz +++ /dev/null @@ -1,120 +0,0 @@ -Panels: - - Class: rviz_common/Displays - Help Height: 78 - Name: Displays - Property Tree Widget: - Expanded: - - /Global Options1 - - /Status1 - - /Image1 - Splitter Ratio: 0.5 - Tree Height: 590 - - Class: rviz_common/Selection - Name: Selection - - Class: rviz_common/Tool Properties - Expanded: - - /2D Nav Goal1 - - /Publish Point1 - Name: Tool Properties - Splitter Ratio: 0.588679016 - - Class: rviz_common/Views - Expanded: - - /Current View1 - Name: Views - Splitter Ratio: 0.5 -Visualization Manager: - Class: "" - Displays: - - Alpha: 0.5 - Cell Size: 1 - Class: rviz_default_plugins/Grid - Color: 160; 160; 164 - Enabled: true - Line Style: - Line Width: 0.0299999993 - Value: Lines - Name: Grid - Normal Cell Count: 0 - Offset: - X: 0 - Y: 0 - Z: 0 - Plane: XY - Plane Cell Count: 10 - Reference Frame: - Value: true - - Class: rviz_default_plugins/Image - Enabled: true - Max Value: 1 - Median window: 5 - Min Value: 0 - Name: Image - Normalize Range: true - Queue Size: 10 - Topic: /ros2_openvino_toolkit/image_rviz - Unreliable: false - Value: true - Enabled: true - Global Options: - Background Color: 48; 48; 48 - Fixed Frame: map - Frame Rate: 30 - Name: root - Tools: - - Class: rviz_default_plugins/MoveCamera - - Class: rviz_default_plugins/Select - - Class: rviz_default_plugins/FocusCamera - - Class: rviz_default_plugins/Measure - Line color: 128; 128; 0 - - Class: rviz_default_plugins/SetInitialPose - Topic: /initialpose - - Class: rviz_default_plugins/SetGoal - Topic: /move_base_simple/goal - - Class: rviz_default_plugins/PublishPoint - Single click: true - Topic: /clicked_point - Transformation: - Current: - Class: rviz_default_plugins/TF - Value: true - Views: - Current: - Class: rviz_default_plugins/Orbit - Distance: 10 - Enable Stereo Rendering: - Stereo Eye Separation: 0.0599999987 - Stereo Focal Distance: 1 - Swap Stereo Eyes: false - Value: false - Focal Point: - X: 0 - Y: 0 - Z: 0 - Focal Shape Fixed Size: true - Focal Shape Size: 0.0500000007 - Invert Z Axis: false - Name: Current View - Near Clip Distance: 0.00999999978 - Pitch: 0.785398006 - Target Frame: - Value: Orbit (rviz) - Yaw: 0.785398006 - Saved: ~ -Window Geometry: - Displays: - collapsed: false - Height: 1056 - Hide Left Dock: false - Hide Right Dock: false - Image: - collapsed: false - QMainWindow State: 000000ff00000000fd00000004000000000000016b000003dafc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730100000028000002dd000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000030b000000f70000002800ffffff000000010000010f000003dafc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730100000028000003da000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004b9000003da00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 - Selection: - collapsed: false - Tool Properties: - collapsed: false - Views: - collapsed: false - Width: 1855 - X: 65 - Y: 24 diff --git a/sample/launch/rviz/default2.rviz b/sample/launch/rviz/people.rviz similarity index 65% rename from sample/launch/rviz/default2.rviz rename to sample/launch/rviz/people.rviz index 1dba52a6..96ad0637 100644 --- a/sample/launch/rviz/default2.rviz +++ b/sample/launch/rviz/people.rviz @@ -7,14 +7,12 @@ Panels: - /Global Options1 - /Status1 - /Image1 - - /Image2 Splitter Ratio: 0.5 - Tree Height: 270 + Tree Height: 256 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties Expanded: - - /2D Nav Goal1 - /Publish Point1 Name: Tool Properties Splitter Ratio: 0.5886790156364441 @@ -51,20 +49,12 @@ Visualization Manager: Min Value: 0 Name: Image Normalize Range: true - Queue Size: 10 - Topic: /ros2_openvino_toolkit/image_rviz1 - Unreliable: false - Value: true - - Class: rviz_default_plugins/Image - Enabled: true - Max Value: 1 - Median window: 5 - Min Value: 0 - Name: Image - Normalize Range: true - Queue Size: 10 - Topic: /ros2_openvino_toolkit/image_rviz2 - Unreliable: false + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /ros2_openvino_toolkit/image_rviz Value: true Enabled: true Global Options: @@ -79,54 +69,69 @@ Visualization Manager: - Class: rviz_default_plugins/Measure Line color: 128; 128; 0 - Class: rviz_default_plugins/SetInitialPose - Topic: /initialpose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose - Class: rviz_default_plugins/SetGoal - Topic: /move_base_simple/goal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /move_base_simple/goal - Class: rviz_default_plugins/PublishPoint Single click: true - Topic: /clicked_point + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point Transformation: Current: Class: rviz_default_plugins/TF Value: true Views: Current: - Class: rviz_default_plugins/Orbit - Distance: 10 + Class: rviz_default_plugins/FPS Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false - Focal Point: - X: 0 - Y: 0 - Z: 0 - Focal Shape Fixed Size: true - Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Pitch: 0.785398006439209 + Pitch: 0.9553166627883911 + Position: + X: 5 + Y: 5 + Z: 10 Target Frame: - Value: Orbit (rviz) - Yaw: 0.785398006439209 + Value: FPS (rviz_default_plugins) + Yaw: 3.9269914627075195 Saved: ~ Window Geometry: Displays: collapsed: false - Height: 846 + Height: 1011 Hide Left Dock: false Hide Right Dock: false Image: collapsed: false - QMainWindow State: 000000ff00000000fd000000040000000000000156000002f4fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000199000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000001dc0000008e0000002800fffffffb0000000a0049006d0061006700650100000270000000c10000002800ffffff000000010000010f000002f4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002f4000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d0065010000000000000450000000000000000000000454000002f400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd00000004000000000000071800000395fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003f0000018e000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000003f000003950000001700ffffff000000010000010f00000395fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003f00000395000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000000200000039500000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Tool Properties: collapsed: false Views: collapsed: false - Width: 1733 - X: 67 - Y: 92 + Width: 1854 + X: 66 + Y: 32 diff --git a/sample/launch/rviz2.launch.py b/sample/launch/rviz2.launch.py index a0fb3a65..a4be749c 100644 --- a/sample/launch/rviz2.launch.py +++ b/sample/launch/rviz2.launch.py @@ -12,24 +12,54 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch rviz2 for ROS2-OpenVINO.""" +""" +ROS 2 Launch File: Standalone RViz2 for OpenVINO Toolkit + +Launches RViz2 with the default configuration for visualizing +OpenVINO toolkit output. Use this when running the pipeline separately. + +For integrated pipeline + visualization, use: +- pipeline_*_topic.launch.py files +- pipeline_object_with_rqt.launch.py (for rqt_image_view) +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node -from launch.substitutions import LaunchConfiguration, PythonExpression -import launch def generate_launch_description(): - default_rviz = os.path.join(get_package_share_directory('openvino_node'), 'launch', - 'rviz/default.rviz') + """Generate launch description for standalone RViz2.""" + + # Get package share directory + package_share_dir = get_package_share_directory('openvino_node') + + # Default RViz configuration + default_rviz_config = os.path.join( + package_share_dir, + 'launch', + 'rviz', + 'default.rviz' + ) + return LaunchDescription([ - # Rviz - launch_ros.actions.Node( + # Declare launch argument for custom RViz config + DeclareLaunchArgument( + name='rviz_config', + default_value=default_rviz_config, + description='Path to RViz2 configuration file' + ), + + # RViz2 node + Node( package='rviz2', - executable='rviz2', output='screen', - arguments=['--display-config', default_rviz]), + executable='rviz2', + name='rviz2', + arguments=['--display-config', LaunchConfiguration('rviz_config')], + output='screen' + ), ]) diff --git a/sample/param/image_object_server.yaml b/sample/param/image_object_server.yaml index 31241ba1..cac75caf 100644 --- a/sample/param/image_object_server.yaml +++ b/sample/param/image_object_server.yaml @@ -4,9 +4,9 @@ Pipelines: input_path: to/be/set/image_path infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame diff --git a/sample/param/image_people_server.yaml b/sample/param/image_people_server.yaml index 21e2a2de..8abc35cd 100644 --- a/sample/param/image_people_server.yaml +++ b/sample/param/image_people_server.yaml @@ -4,26 +4,26 @@ Pipelines: input_path: to/be/set/image_path infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/FIXME.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/FIXME.labels batch: 16 outputs: [RosService, RViz] connects: diff --git a/sample/param/multi_pipleine_service.yaml b/sample/param/multi_pipeline_service.yaml similarity index 75% rename from sample/param/multi_pipleine_service.yaml rename to sample/param/multi_pipeline_service.yaml index 4fdc71e1..9216ff6b 100644 --- a/sample/param/multi_pipleine_service.yaml +++ b/sample/param/multi_pipeline_service.yaml @@ -3,18 +3,18 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] + right: [RosTopic] - left: ObjectDetection right: [RosTopic] - left: ObjectDetection @@ -24,21 +24,21 @@ Pipelines: inputs: [RealSenseCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: RealSenseCamera right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] + right: [RosTopic] - left: ObjectDetection right: [RosTopic] - left: ObjectDetection right: [RViz] - + OpenvinoCommon: diff --git a/sample/param/pipeline_composite_object_topic.yaml b/sample/param/pipeline_composite_object_topic.yaml index b9d71e0c..d9580e22 100644 --- a/sample/param/pipeline_composite_object_topic.yaml +++ b/sample/param/pipeline_composite_object_topic.yaml @@ -3,9 +3,9 @@ Pipelines: inputs: [RealSenseCameraTopic] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml - engine: CPU #MYRIAD - label: to/be/set/xxx.labels + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + engine: CPU #NPU + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame diff --git a/sample/param/pipeline_face_reidentification.yaml b/sample/param/pipeline_face_reidentification.yaml index c2cd0f5a..a33e5331 100644 --- a/sample/param/pipeline_face_reidentification.yaml +++ b/sample/param/pipeline_face_reidentification.yaml @@ -3,34 +3,34 @@ Pipelines: inputs: [RealSenseCamera] infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: LandmarksDetection - model: /opt/openvino_toolkit/models/intel/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml + model: /models/intel/landmarks-regression-retail-0009/FP32/landmarks-regression-retail-0009.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/landmarks-regression/landmarks-regression-retail-0009.labels batch: 1 - name: FaceReidentification - model: /opt/openvino_toolkit/models/intel/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml + model: /models/intel/face-reidentification-retail-0095/FP32/face-reidentification-retail-0095.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/face-reidentification/face-reidentification-retail-0095.labels batch: 1 confidence_threshold: 0.9 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: RealSenseCamera right: [FaceDetection] - left: FaceDetection right: [LandmarksDetection, FaceReidentification] - left: FaceDetection - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: LandmarksDetection - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: FaceReidentification - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] Common: diff --git a/sample/param/pipeline_image.yaml b/sample/param/pipeline_image.yaml index ccc39c73..93ff3ab1 100644 --- a/sample/param/pipeline_image.yaml +++ b/sample/param/pipeline_image.yaml @@ -1,41 +1,41 @@ -Pipelines: +Pipelines: - name: people inputs: [Image] - input_path: /home/skl/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/age-gender-recognition/age-gender-recognition-retail-0013.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/head-pose-estimation/head-pose-estimation-adas-0001.labels batch: 16 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: Image right: [FaceDetection] - left: FaceDetection - right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, ImageWindow, RosTopic, RViz] + right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, RosTopic, RViz] - left: AgeGenderRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: EmotionRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: HeadPoseEstimation - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] Common: diff --git a/sample/param/pipeline_image_ci.yaml b/sample/param/pipeline_image_ci.yaml index 37da03ba..3b73ac59 100644 --- a/sample/param/pipeline_image_ci.yaml +++ b/sample/param/pipeline_image_ci.yaml @@ -1,29 +1,29 @@ -Pipelines: +Pipelines: - name: people inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/FIXME.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/FIXME.labels batch: 16 outputs: [RosTopic] connects: diff --git a/sample/param/pipeline_image_video.yaml b/sample/param/pipeline_image_video.yaml index b383f30f..aefdf845 100644 --- a/sample/param/pipeline_image_video.yaml +++ b/sample/param/pipeline_image_video.yaml @@ -4,38 +4,38 @@ Pipelines: input_path: to/be/set/video_path infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/age-gender-recognition/age-gender-recognition-retail-0013.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/head-pose-estimation/head-pose-estimation-adas-0001.labels batch: 16 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: Video right: [FaceDetection] - left: FaceDetection - right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, ImageWindow, RosTopic, RViz] + right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, RosTopic, RViz] - left: AgeGenderRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: EmotionRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: HeadPoseEstimation - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] Common: diff --git a/sample/param/pipeline_object.yaml b/sample/param/pipeline_object.yaml index 14042031..9a2f1c9e 100644 --- a/sample/param/pipeline_object.yaml +++ b/sample/param/pipeline_object.yaml @@ -3,19 +3,19 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml - engine: CPU - label: to/be/set/xxx.labels + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + engine: CPU #GPU #NPU + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] + right: [RosTopic, RViz] - left: ObjectDetection - right: [RosTopic] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_object_topic.yaml b/sample/param/pipeline_object_topic.yaml index 88d5a44d..d74c51d6 100644 --- a/sample/param/pipeline_object_topic.yaml +++ b/sample/param/pipeline_object_topic.yaml @@ -3,21 +3,17 @@ Pipelines: inputs: [StandardCamera] #[RealSenseCameraTopic] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml - engine: CPU #MYRIAD - label: to/be/set/xxx.labels + model: /models/convert/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml + engine: CPU #NPU + label: /labels/object_detection/mobilenet-ssd.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera #RealSenseCameraTopic right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] - - left: ObjectDetection - right: [RosTopic] - - left: ObjectDetection - right: [RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_object_yolo.yaml b/sample/param/pipeline_object_yolo.yaml index a80fc4c3..44cc2a25 100644 --- a/sample/param/pipeline_object_yolo.yaml +++ b/sample/param/pipeline_object_yolo.yaml @@ -4,24 +4,20 @@ Pipelines: input_path: to/be/set/image_path infers: - name: ObjectDetection - #model: /opt/openvino_toolkit/models/convert/public/yolov5n/FP32/yolov5n.xml - model: /home/lewis/develop/openvino/models/models/yolo/yolov7/yolov7_int8.xml - #model: /home/lewis/develop/openvino/models/models/yolo/yolov8/yolov8n_openvino_int8_model/yolov8n.xml + #model: /models/convert/public/yolov5n/FP32/yolov5n.xml + model: /models/yolov7_int8.xml + #model: /models/yolov8n_openvino_int8_model/yolov8n.xml model_type: yolov5 #yolov8 - engine: CPU #MYRIAD - label: to/be/set/xxx.labels + engine: CPU #NPU + label: /labels/object_detection/coco.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] - - left: ObjectDetection - right: [RosTopic] - - left: ObjectDetection - right: [RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_object_yolo_topic.yaml b/sample/param/pipeline_object_yolo_topic.yaml index fdff4264..d4405ca5 100644 --- a/sample/param/pipeline_object_yolo_topic.yaml +++ b/sample/param/pipeline_object_yolo_topic.yaml @@ -3,22 +3,18 @@ Pipelines: inputs: [RealSenseCameraTopic] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/yolov5n/FP32/yolov5n.xml + model: /models/convert/public/yolov5n/FP32/yolov5n.xml model_type: yolov5 - engine: MYRIAD - label: to/be/set/xxx.labels + engine: GPU #CPU + label: /labels/object_detection/coco.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: RealSenseCameraTopic right: [ObjectDetection] - left: ObjectDetection - right: [ImageWindow] - - left: ObjectDetection - right: [RosTopic] - - left: ObjectDetection - right: [RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_object_yolov5_ci.yaml b/sample/param/pipeline_object_yolov5_ci.yaml index 7804ecb0..f26c19f3 100644 --- a/sample/param/pipeline_object_yolov5_ci.yaml +++ b/sample/param/pipeline_object_yolov5_ci.yaml @@ -1,13 +1,13 @@ Pipelines: - name: object inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/yolov5n/FP32/yolov5n.xml + model: /models/convert/public/yolov5n/FP32/yolov5n.xml model_type: yolov5 - engine: CPU #MYRIAD - label: to/be/set/xxx.labels + engine: CPU #NPU + label: /labels/object_detection/coco.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame diff --git a/sample/param/pipeline_object_yolov8_ci.yaml b/sample/param/pipeline_object_yolov8_ci.yaml index 37b6ad91..ad2537d8 100644 --- a/sample/param/pipeline_object_yolov8_ci.yaml +++ b/sample/param/pipeline_object_yolov8_ci.yaml @@ -1,13 +1,13 @@ Pipelines: - name: object inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/convert/public/FP32/yolov8n/yolov8n.xml + model: /models/convert/public/yolov8n/FP32/yolov8n.xml model_type: yolov8 - engine: CPU #MYRIAD - label: to/be/set/xxx.labels + engine: CPU #NPU + label: /labels/object_detection/coco.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame diff --git a/sample/param/pipeline_people.yaml b/sample/param/pipeline_people.yaml index 6d9805e0..b6e2a56d 100644 --- a/sample/param/pipeline_people.yaml +++ b/sample/param/pipeline_people.yaml @@ -1,40 +1,40 @@ Pipelines: - name: people inputs: [StandardCamera] - infers: + infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml - engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + engine: NPU #CPU #GPU + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/age-gender-recognition/age-gender-recognition-retail-0013.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/head-pose-estimation/head-pose-estimation-adas-0001.labels batch: 16 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [FaceDetection] - left: FaceDetection - right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, ImageWindow, RosTopic, RViz] + right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, RosTopic, RViz] - left: AgeGenderRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: EmotionRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: HeadPoseEstimation - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] Common: diff --git a/sample/param/pipeline_people_ci.yaml b/sample/param/pipeline_people_ci.yaml index ce0a1e90..3b26bd51 100644 --- a/sample/param/pipeline_people_ci.yaml +++ b/sample/param/pipeline_people_ci.yaml @@ -1,29 +1,29 @@ Pipelines: - name: people inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg - infers: + input_path: /images/sample_faces.jpg + infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/age-gender-recognition/age-gender-recognition-retail-0013.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/head-pose-estimation/head-pose-estimation-adas-0001.labels batch: 16 outputs: [RosTopic] connects: diff --git a/sample/param/pipeline_people_ip.yaml b/sample/param/pipeline_people_ip.yaml index b37903c1..92a84408 100644 --- a/sample/param/pipeline_people_ip.yaml +++ b/sample/param/pipeline_people_ip.yaml @@ -4,38 +4,38 @@ Pipelines: input_path: "rtsp://" infers: - name: FaceDetection - model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml + model: /models/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.labels + label: /labels/face_detection/face-detection-adas-0001.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: AgeGenderRecognition - model: /opt/openvino_toolkit/models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml + model: /models/intel/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/age-gender-recognition/age-gender-recognition-retail-0013.labels batch: 16 - name: EmotionRecognition - model: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml + model: /models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/emotions-recognition-retail-0003/FP32/emotions-recognition-retail-0003.labels + label: /labels/emotions-recognition/FP32/emotions-recognition-retail-0003.labels batch: 16 - name: HeadPoseEstimation - model: /opt/openvino_toolkit/models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml + model: /models/intel/head-pose-estimation-adas-0001/FP32/head-pose-estimation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/head-pose-estimation/head-pose-estimation-adas-0001.labels batch: 16 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: IpCamera right: [FaceDetection] - left: FaceDetection - right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, ImageWindow, RosTopic, RViz] + right: [AgeGenderRecognition, EmotionRecognition, HeadPoseEstimation, RosTopic, RViz] - left: AgeGenderRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: EmotionRecognition - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: HeadPoseEstimation - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_person_attributes.yaml b/sample/param/pipeline_person_attributes.yaml index 8721c40f..f706063d 100644 --- a/sample/param/pipeline_person_attributes.yaml +++ b/sample/param/pipeline_person_attributes.yaml @@ -3,25 +3,25 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml + model: /models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/person-detection.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: PersonAttribsDetection - model: /opt/openvino_toolkit/models/intel/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml + model: /models/intel/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/person-attributes-recognition/person-attributes-recognition-crossroad-0230.labels batch: 1 confidence_threshold: 0.5 - outputs: [ImageWindow, RViz, RosTopic] + outputs: [RViz, RosTopic] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection - right: [PersonAttribsDetection, ImageWindow, RosTopic, RViz] + right: [PersonAttribsDetection, RosTopic, RViz] - left: PersonAttribsDetection - right: [ImageWindow, RViz, RosTopic] + right: [RViz, RosTopic] OpenvinoCommon: diff --git a/sample/param/pipeline_person_attributes_ci.yaml b/sample/param/pipeline_person_attributes_ci.yaml index 786c2461..efeccca3 100644 --- a/sample/param/pipeline_person_attributes_ci.yaml +++ b/sample/param/pipeline_person_attributes_ci.yaml @@ -1,19 +1,19 @@ Pipelines: - name: object inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml + model: /models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/person-detection.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: PersonAttribsDetection - model: /opt/openvino_toolkit/models/intel/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml + model: /models/intel/person-attributes-recognition-crossroad-0230/FP32/person-attributes-recognition-crossroad-0230.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/person-attributes-recognition/person-attributes-recognition-crossroad-0230.labels batch: 1 confidence_threshold: 0.5 outputs: [RosTopic] diff --git a/sample/param/pipeline_reidentification.yaml b/sample/param/pipeline_reidentification.yaml index 2598031b..78eeba10 100644 --- a/sample/param/pipeline_reidentification.yaml +++ b/sample/param/pipeline_reidentification.yaml @@ -3,25 +3,25 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml + model: /models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/person-detection.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: PersonReidentification - model: /opt/openvino_toolkit/models/intel/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml + model: /models/intel/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/person-reidentification/person-reidentification-retail-0277.labels batch: 1 confidence_threshold: 0.7 - outputs: [ImageWindow, RViz, RosTopic] + outputs: [RViz, RosTopic] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection right: [PersonReidentification] - left: PersonReidentification - right: [ImageWindow, RViz, RosTopic] + right: [RViz, RosTopic] OpenvinoCommon: diff --git a/sample/param/pipeline_reidentification_ci.yaml b/sample/param/pipeline_reidentification_ci.yaml index 72b8f22a..a4164424 100644 --- a/sample/param/pipeline_reidentification_ci.yaml +++ b/sample/param/pipeline_reidentification_ci.yaml @@ -1,19 +1,19 @@ Pipelines: - name: object inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml + model: /models/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_detection/person-detection.labels batch: 1 confidence_threshold: 0.5 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: PersonReidentification - model: /opt/openvino_toolkit/models/intel/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml + model: /models/intel/person-reidentification-retail-0277/FP32/person-reidentification-retail-0277.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/person-reidentification/person-reidentification-retail-0277.labels batch: 1 confidence_threshold: 0.7 outputs: [RosTopic] diff --git a/sample/param/pipeline_segmentation.yaml b/sample/param/pipeline_segmentation.yaml index f0eccb13..6617e8dc 100644 --- a/sample/param/pipeline_segmentation.yaml +++ b/sample/param/pipeline_segmentation.yaml @@ -3,17 +3,17 @@ Pipelines: inputs: [RealSenseCameraTopic] infers: - name: ObjectSegmentation - model: /opt/openvino_toolkit/models/convert/public/deeplabv3/FP16/deeplabv3.xml - engine: CPU #"HETERO:CPU,GPU,MYRIAD" - label: to/be/set/xxx.labels + model: /models/convert/public/deeplabv3/FP16/deeplabv3.xml + engine: CPU #"HETERO:CPU,GPU,NPU" + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: RealSenseCameraTopic right: [ObjectSegmentation] - left: ObjectSegmentation - right: [ImageWindow] + right: [RosTopic] - left: ObjectSegmentation right: [RosTopic] - left: ObjectSegmentation diff --git a/sample/param/pipeline_segmentation_ci.yaml b/sample/param/pipeline_segmentation_ci.yaml index b8f075c2..c93e8ceb 100644 --- a/sample/param/pipeline_segmentation_ci.yaml +++ b/sample/param/pipeline_segmentation_ci.yaml @@ -1,12 +1,12 @@ Pipelines: - name: segmentation inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_car.png + input_path: /images/sample_car.png infers: - name: ObjectSegmentation - model: /opt/openvino_toolkit/models/convert/public/deeplabv3/FP16/deeplabv3.xml - engine: CPU #"HETERO:CPU,GPU,MYRIAD" - label: to/be/set/xxx.labels + model: /models/convert/public/deeplabv3/FP16/deeplabv3.xml + engine: CPU #"HETERO:CPU,GPU,NPU" + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 outputs: [RosTopic] diff --git a/sample/param/pipeline_segmentation_image.yaml b/sample/param/pipeline_segmentation_image.yaml index 33481f8b..5265c1ca 100644 --- a/sample/param/pipeline_segmentation_image.yaml +++ b/sample/param/pipeline_segmentation_image.yaml @@ -1,23 +1,19 @@ Pipelines: - name: segmentation inputs: [Image] - input_path: to/be/set/image_path + input_path: /images/sample_faces.jpg infers: - name: ObjectSegmentation - model: /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml + model: /models/intel/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: Image right: [ObjectSegmentation] - left: ObjectSegmentation - right: [ImageWindow] - - left: ObjectSegmentation - right: [RosTopic] - - left: ObjectSegmentation - right: [RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_segmentation_image_ci.yaml b/sample/param/pipeline_segmentation_image_ci.yaml index c80832bc..ab962f34 100644 --- a/sample/param/pipeline_segmentation_image_ci.yaml +++ b/sample/param/pipeline_segmentation_image_ci.yaml @@ -1,12 +1,12 @@ Pipelines: - name: segmentation inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_car.png + input_path: /images/sample_car.png infers: - name: ObjectSegmentation - model: /opt/openvino_toolkit/models/intel/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml + model: /models/intel/semantic-segmentation-adas-0001/FP16/semantic-segmentation-adas-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 outputs: [RosTopic] diff --git a/sample/param/pipeline_segmentation_instance.yaml b/sample/param/pipeline_segmentation_instance.yaml index f29352b3..88b6a1b0 100644 --- a/sample/param/pipeline_segmentation_instance.yaml +++ b/sample/param/pipeline_segmentation_instance.yaml @@ -4,27 +4,23 @@ Pipelines: infers: - name: ObjectSegmentationInstance # for Yolov8 Seg models ----------------- - model: /opt/openvino_toolkit/models/convert/public/yolov8n-seg/FP32/yolov8n-seg.xml + model: /models/convert/public/yolov8n-seg/FP32/yolov8n-seg.xml model_type: yolo - label: /opt/openvino_toolkit/labels/object_detection/coco.names + label: /labels/object_detection/coco.labels # for maskrcnn inception resnet ----------------- - #model: /opt/openvino_toolkit/models/convert/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP32/mask_rcnn_inception_resnet_v2_atrous_coco.xml + #model: /models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP32/mask_rcnn_inception_resnet_v2_atrous_coco.xml #model_type: maskrcnn - #label: /opt/openvino_toolkit/labels/object_segmentation/frozen_inference_graph.labels #for maskrcnn + #label: /labels/object_segmentation/frozen_inference_graph.labels #for maskrcnn #---------------------- - engine: CPU #"HETERO:CPU,GPU," #"HETERO:CPU,GPU,MYRIAD" + engine: CPU #"HETERO:CPU,GPU," #"HETERO:CPU,GPU,NPU" batch: 1 confidence_threshold: 0.5 nms_threshold: 0.5 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [ObjectSegmentationInstance] - left: ObjectSegmentationInstance - right: [ImageWindow] - - left: ObjectSegmentationInstance - right: [RosTopic] - - left: ObjectSegmentationInstance - right: [RViz] + right: [RosTopic, RViz] Common: diff --git a/sample/param/pipeline_segmentation_instance_yolov8_seg_ci.yaml b/sample/param/pipeline_segmentation_instance_yolov8_seg_ci.yaml index ffc3f276..b01c548a 100644 --- a/sample/param/pipeline_segmentation_instance_yolov8_seg_ci.yaml +++ b/sample/param/pipeline_segmentation_instance_yolov8_seg_ci.yaml @@ -1,15 +1,15 @@ Pipelines: - name: segmentation inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg + input_path: /images/sample_faces.jpg infers: - name: ObjectSegmentationInstance # for Yolov8 Seg models ----------------- - model: /opt/openvino_toolkit/models/convert/public/FP32/yolov8n-seg/yolov8n-seg.xml + model: /models/FP32/yolov8n-seg/yolov8n-seg.xml model_type: yolov8 - label: /opt/openvino_toolkit/labels/object_detection/coco.names - engine: CPU #"HETERO:CPU,GPU," #"HETERO:CPU,GPU,MYRIAD" + label: /labels/object_detection/coco.names + engine: CPU #"HETERO:CPU,GPU," #"HETERO:CPU,GPU,NPU" batch: 1 confidence_threshold: 0.5 outputs: [RosTopic] @@ -17,7 +17,7 @@ Pipelines: - left: Image right: [ObjectSegmentationInstance] - left: ObjectSegmentationInstance - right: [ImageWindow] + right: [RosTopic] - left: ObjectSegmentationInstance right: [RosTopic] diff --git a/sample/param/pipeline_segmentation_maskrcnn.yaml b/sample/param/pipeline_segmentation_maskrcnn.yaml index fa47f088..9d20c6c1 100644 --- a/sample/param/pipeline_segmentation_maskrcnn.yaml +++ b/sample/param/pipeline_segmentation_maskrcnn.yaml @@ -3,17 +3,17 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectSegmentationMaskrcnn - model: /opt/openvino_toolkit/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/mask_rcnn_inception_resnet_v2_atrous_coco.xml - engine: CPU #"HETERO:CPU,GPU,MYRIAD" - label: to/be/set/xxx.labels + model: /models/convert/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/mask_rcnn_inception_resnet_v2_atrous_coco.xml + engine: GPU + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: StandardCamera right: [ObjectSegmentationMaskrcnn] - left: ObjectSegmentationMaskrcnn - right: [ImageWindow] + right: [RosTopic] - left: ObjectSegmentationMaskrcnn right: [RosTopic] - left: ObjectSegmentationMaskrcnn diff --git a/sample/param/pipeline_segmentation_maskrcnn_ci.yaml b/sample/param/pipeline_segmentation_maskrcnn_ci.yaml index 855b6833..e5413990 100644 --- a/sample/param/pipeline_segmentation_maskrcnn_ci.yaml +++ b/sample/param/pipeline_segmentation_maskrcnn_ci.yaml @@ -1,12 +1,12 @@ Pipelines: - name: segmentation inputs: [Image] - input_path: /root/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_car.png + input_path: /images/sample_car.png infers: - name: ObjectSegmentationMaskrcnn - model: /opt/openvino_toolkit/models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/mask_rcnn_inception_resnet_v2_atrous_coco.xml - engine: CPU #"HETERO:CPU,GPU,MYRIAD" - label: to/be/set/xxx.labels + model: /models/public/mask_rcnn_inception_resnet_v2_atrous_coco/FP16/mask_rcnn_inception_resnet_v2_atrous_coco.xml + engine: CPU #"HETERO:CPU,GPU,NPU" + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 outputs: [RosTopic] diff --git a/sample/param/pipeline_vehicle_detection.yaml b/sample/param/pipeline_vehicle_detection.yaml index 3eff9e59..ac581ee2 100644 --- a/sample/param/pipeline_vehicle_detection.yaml +++ b/sample/param/pipeline_vehicle_detection.yaml @@ -3,32 +3,32 @@ Pipelines: inputs: [StandardCamera] infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml + model: /models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.labels + label: /labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels batch: 1 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: VehicleAttribsDetection - model: /opt/openvino_toolkit/models/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml + model: /models/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/vehicle-attributes-recognition/vehicle-attributes-recognition-barrier-0039.labels batch: 1 - name: LicensePlateDetection - model: /opt/openvino_toolkit/models/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml + model: /models/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/license-plate-recognition/license-plate-recognition-barrier-0001.labels batch: 1 - outputs: [ImageWindow, RViz, RosTopic] + outputs: [RViz, RosTopic] connects: - left: StandardCamera right: [ObjectDetection] - left: ObjectDetection right: [{VehicleAttribsDetection: label == vehicle && confidence >= 0.8}, {LicensePlateDetection: label == license && confidence >= 0.8}] - left: ObjectDetection - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: VehicleAttribsDetection - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] - left: LicensePlateDetection - right: [ImageWindow, RosTopic, RViz] + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/pipeline_vehicle_detection_ci.yaml b/sample/param/pipeline_vehicle_detection_ci.yaml index 760ff276..748b0066 100644 --- a/sample/param/pipeline_vehicle_detection_ci.yaml +++ b/sample/param/pipeline_vehicle_detection_ci.yaml @@ -1,23 +1,23 @@ Pipelines: - name: object inputs: [Image] - input_path: /root/jpg/car.jpg + input_path: /images/car_1.bmp infers: - name: ObjectDetection - model: /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml + model: /models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml engine: CPU - label: /opt/openvino_toolkit/models/intel/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.labels + label: /labels/object_detection/vehicle-license-plate-detection-barrier-0106.labels batch: 1 enable_roi_constraint: true # set enable_roi_constraint to false if you don't want to make the inferred ROI (region of interest) constrained into the camera frame - name: VehicleAttribsDetection - model: /opt/openvino_toolkit/models/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml + model: /models/intel/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/vehicle-attributes-recognition/vehicle-attributes-recognition-barrier-0039.labels batch: 1 - name: LicensePlateDetection - model: /opt/openvino_toolkit/models/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml + model: /models/intel/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml engine: CPU - label: to/be/set/xxx.labels + label: /labels/license-plate-recognition/license-plate-recognition-barrier-0001.labels batch: 1 outputs: [RosTopic] connects: @@ -26,7 +26,7 @@ Pipelines: - left: ObjectDetection right: [{VehicleAttribsDetection: label == vehicle && confidence >= 0.8}, {LicensePlateDetection: label == license && confidence >= 0.8}] - left: ObjectDetection - right: [RosTopic] + right: [RosTopic] - left: VehicleAttribsDetection right: [RosTopic] - left: LicensePlateDetection diff --git a/sample/param/pipeline_video.yaml b/sample/param/pipeline_video.yaml index 0493ca76..934ca77b 100644 --- a/sample/param/pipeline_video.yaml +++ b/sample/param/pipeline_video.yaml @@ -4,22 +4,16 @@ Pipelines: input_path: to/be/set/video_path infers: - name: ObjectSegmentation - model: /opt/openvino_toolkit/models/convert/public/deeplabv3/FP16/deeplabv3.xml - engine: CPU - label: to/be/set/xxx.labels + model: /models/convert/public/deeplabv3/FP16/deeplabv3.xml + engine: CPU #GPU + label: /labels/object_segmentation/frozen_inference_graph.labels batch: 1 confidence_threshold: 0.5 - outputs: [ImageWindow, RosTopic, RViz] + outputs: [RosTopic, RViz] connects: - left: Video right: [ObjectSegmentation] - left: ObjectSegmentation - right: [ImageWindow] - - left: ObjectSegmentation - right: [RosTopic] - - left: ObjectSegmentation - right: [RViz] - - + right: [RosTopic, RViz] OpenvinoCommon: diff --git a/sample/param/testParam/param/pipeline_vehicle_detection_test.yaml b/sample/param/testParam/param/pipeline_vehicle_detection_test.yaml index ae4c173b..077e596b 100644 --- a/sample/param/testParam/param/pipeline_vehicle_detection_test.yaml +++ b/sample/param/testParam/param/pipeline_vehicle_detection_test.yaml @@ -26,7 +26,7 @@ Pipelines: - left: ObjectDetection right: [{VehicleAttribsDetection: label == vehicle && confidence >= 0.8}, {LicensePlateDetection: label == license && confidence >= 0.8}] - left: ObjectDetection - right: [RosTopic] + right: [RosTopic] - left: VehicleAttribsDetection right: [RosTopic] - left: LicensePlateDetection diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index faa2a20d..0e6ae585 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -141,6 +141,9 @@ if(BUILD_TESTING) macro(custom_gtest target) ament_add_gtest(${target} ${ARGN}) if(TARGET ${target}) + # Link against OpenVINO first to resolve symbols + target_link_libraries(${target} + openvino::runtime) ament_target_dependencies(${target} "rclcpp" "openvino_param_lib" diff --git a/tests/launch/image_object_service_test.launch.py b/tests/launch/image_object_service_test.launch.py index 9b8ecb32..d8850445 100644 --- a/tests/launch/image_object_service_test.launch.py +++ b/tests/launch/image_object_service_test.launch.py @@ -12,22 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Image Object Service Test + +Launches the OpenVINO object detection service for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'image_object_service_test.yaml') + """Generate launch description for image object service test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'image_object_service_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='image_object_server', - arguments=['-config', default_yaml], - output='screen'), + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO image object service test node + Node( + package='openvino_node', + executable='image_object_server', + name='image_object_test_server', + arguments=['-config', LaunchConfiguration('yaml_path')], + output='screen' + ), ]) diff --git a/tests/launch/image_people_service_test.launch.py b/tests/launch/image_people_service_test.launch.py index a9519dd4..a0b5b18c 100644 --- a/tests/launch/image_people_service_test.launch.py +++ b/tests/launch/image_people_service_test.launch.py @@ -12,22 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Image People Service Test + +Launches the OpenVINO people analytics service for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'image_people_service_test.yaml') + """Generate launch description for image people service test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'image_people_service_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='image_people_server', - arguments=['-config', default_yaml], - output='screen'), + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO image people service test node + Node( + package='openvino_node', + executable='image_people_server', + name='image_people_test_server', + arguments=['-config', LaunchConfiguration('yaml_path')], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_face_reidentification_test.launch.py b/tests/launch/pipeline_face_reidentification_test.launch.py index 9515a86e..71565470 100644 --- a/tests/launch/pipeline_face_reidentification_test.launch.py +++ b/tests/launch/pipeline_face_reidentification_test.launch.py @@ -12,29 +12,50 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Face Re-identification Pipeline Test + +Launches the OpenVINO face re-identification pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_face_reidentification_test.yaml') + """Generate launch description for face re-identification test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_face_reidentification_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO face re-identification test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ - ('/openvino_toolkit/people/detected_objects', '/ros2_openvino_toolkit/face_detection'), + ('/openvino_toolkit/people/detected_objects', + '/ros2_openvino_toolkit/face_detection'), ('/openvino_toolkit/people/detected_landmarks', '/ros2_openvino_toolkit/detected_landmarks'), ('/openvino_toolkit/people/reidentified_faces', - '/ros2_openvino_toolkit/reidentified_faces')], - output='screen'), - + '/ros2_openvino_toolkit/reidentified_faces'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_face_test.launch.py b/tests/launch/pipeline_face_test.launch.py index 2311342e..ad094174 100644 --- a/tests/launch/pipeline_face_test.launch.py +++ b/tests/launch/pipeline_face_test.launch.py @@ -12,23 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Face Detection Pipeline Test + +Launches the OpenVINO face detection with analytics pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_face_test.yaml') + """Generate launch description for face detection test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_face_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO face detection test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/detected_objects', '/ros2_openvino_toolkit/face_detection'), @@ -38,6 +57,9 @@ def generate_launch_description(): '/ros2_openvino_toolkit/headposes_estimation'), ('/openvino_toolkit/people/age_genders', '/ros2_openvino_toolkit/age_genders_Recognition'), - ('/openvino_toolkit/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), + ('/openvino_toolkit/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_image_test.launch.py b/tests/launch/pipeline_image_test.launch.py index e4a2b738..20b0ae0d 100644 --- a/tests/launch/pipeline_image_test.launch.py +++ b/tests/launch/pipeline_image_test.launch.py @@ -12,23 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Image Pipeline Test + +Launches the OpenVINO people analytics pipeline on static images for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_image_test.yaml') + """Generate launch description for image pipeline test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_image_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO image pipeline test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/people/detected_objects', '/ros2_openvino_toolkit/face_detection'), @@ -38,6 +57,9 @@ def generate_launch_description(): '/ros2_openvino_toolkit/headposes_estimation'), ('/openvino_toolkit/people/age_genders', '/ros2_openvino_toolkit/age_genders_Recognition'), - ('/openvino_toolkit/images', '/ros2_openvino_toolkit/image_rviz')], - output='screen'), + ('/openvino_toolkit/images', + '/ros2_openvino_toolkit/image_rviz'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_object_test.launch.py b/tests/launch/pipeline_object_test.launch.py index 752080c7..33b5cf19 100644 --- a/tests/launch/pipeline_object_test.launch.py +++ b/tests/launch/pipeline_object_test.launch.py @@ -12,25 +12,46 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Object Detection Pipeline Test + +Launches the OpenVINO object detection pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_object_test.yaml') + """Generate launch description for object detection test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_object_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO object detection test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', - '/ros2_openvino_toolkit/detected_objects')], - output='screen'), + '/ros2_openvino_toolkit/detected_objects'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_reidentification_test.launch.py b/tests/launch/pipeline_reidentification_test.launch.py index 080d619c..7f3bd38a 100644 --- a/tests/launch/pipeline_reidentification_test.launch.py +++ b/tests/launch/pipeline_reidentification_test.launch.py @@ -12,28 +12,48 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Person Re-identification Pipeline Test + +Launches the OpenVINO person re-identification pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_reidentification_test.yaml') + """Generate launch description for person re-identification test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_reidentification_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO person re-identification test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_objects', '/ros2_openvino_toolkit/detected_objects'), ('/openvino_toolkit/object/reidentified_persons', - '/ros2_openvino_toolkit/reidentified_persons')], - output='screen'), - + '/ros2_openvino_toolkit/reidentified_persons'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_segmentation_test.launch.py b/tests/launch/pipeline_segmentation_test.launch.py index 9760e41c..137e37f3 100644 --- a/tests/launch/pipeline_segmentation_test.launch.py +++ b/tests/launch/pipeline_segmentation_test.launch.py @@ -12,25 +12,46 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Semantic Segmentation Pipeline Test + +Launches the OpenVINO semantic segmentation pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_segmentation_test.yaml') + """Generate launch description for semantic segmentation test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_segmentation_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO semantic segmentation test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/segmentation/segmented_objects', - '/ros2_openvino_toolkit/segmented_objects')], - output='screen'), + '/ros2_openvino_toolkit/segmented_objects'), + ], + output='screen' + ), ]) diff --git a/tests/launch/pipeline_vehicle_detection_test.launch.py b/tests/launch/pipeline_vehicle_detection_test.launch.py index deb7cda3..20a03f38 100644 --- a/tests/launch/pipeline_vehicle_detection_test.launch.py +++ b/tests/launch/pipeline_vehicle_detection_test.launch.py @@ -12,28 +12,48 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Launch face detection and rviz.""" +""" +ROS 2 Test Launch File: Vehicle Detection Pipeline Test + +Launches the OpenVINO vehicle detection pipeline for automated testing. +""" import os from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -import launch_ros.actions +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node def generate_launch_description(): - default_yaml = os.path.join(get_package_share_directory('openvino_test'), 'param', - 'pipeline_vehicle_detection_test.yaml') + """Generate launch description for vehicle detection test.""" + + # Get test package share directory + test_package_dir = get_package_share_directory('openvino_test') + default_yaml = os.path.join(test_package_dir, 'param', 'pipeline_vehicle_detection_test.yaml') + return LaunchDescription([ - # Openvino detection - launch_ros.actions.Node( - package='openvino_node', node_executable='pipeline_with_params', - arguments=['-config', default_yaml], + # Declare launch argument for YAML configuration + DeclareLaunchArgument( + name='yaml_path', + default_value=default_yaml, + description='Path to test YAML configuration file' + ), + + # OpenVINO vehicle detection test node + Node( + package='openvino_node', + executable='pipeline_with_params', + name='openvino_test_pipeline', + arguments=['-config', LaunchConfiguration('yaml_path')], remappings=[ ('/openvino_toolkit/object/detected_license_plates', '/ros2_openvino_toolkit/detected_license_plates'), ('/openvino_toolkit/object/detected_vehicles_attribs', - '/ros2_openvino_toolkit/detected_vehicles_attribs')], - output='screen'), - + '/ros2_openvino_toolkit/detected_vehicles_attribs'), + ], + output='screen' + ), ]) From 49bff124e138eafb4cc9019dc0f140e13c0c6cad Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 18:31:35 +0100 Subject: [PATCH 03/14] [ROS2] [Jazzy] Update CI workflows for Ubuntu versions and enhance code formatting checks --- .github/workflows/basic_func_tests.yml | 16 +++- .github/workflows/code_format.yml | 19 +++-- .github/workflows/ubuntu-22.04-humble.yml | 66 ++++++++++++++++ .github/workflows/ubuntu-24.04-jazzy.yml | 77 +++++++++++++++++++ .../models/attributes/base_attribute.hpp | 4 +- .../openvino_wrapper_lib/utils/common.hpp | 2 +- .../utils/version_info.hpp | 6 +- .../src/inferences/age_gender_detection.cpp | 4 +- .../src/inferences/base_reidentification.cpp | 6 +- .../src/inferences/emotions_detection.cpp | 4 +- .../src/inferences/face_reidentification.cpp | 4 +- .../src/inferences/head_pose_detection.cpp | 4 +- .../src/inferences/landmarks_detection.cpp | 4 +- .../src/inferences/object_segmentation.cpp | 4 +- .../object_segmentation_instance.cpp | 4 +- .../object_segmentation_maskrcnn.cpp | 4 +- .../src/models/object_segmentation_model.cpp | 4 +- openvino_wrapper_lib/src/pipeline.cpp | 5 +- sample/include/utility.hpp | 2 +- sample/src/image_object_server.cpp | 3 +- sample/src/image_people_server.cpp | 3 +- sample/src/pipeline_composite.cpp | 2 +- 22 files changed, 201 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/ubuntu-22.04-humble.yml create mode 100644 .github/workflows/ubuntu-24.04-jazzy.yml diff --git a/.github/workflows/basic_func_tests.yml b/.github/workflows/basic_func_tests.yml index 2bef0510..a5f49710 100644 --- a/.github/workflows/basic_func_tests.yml +++ b/.github/workflows/basic_func_tests.yml @@ -30,7 +30,17 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-20.04 + runs-on: ${{ matrix.ubuntu-version }} + strategy: + matrix: + ubuntu-version: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + include: + - ubuntu-version: ubuntu-20.04 + dockerfile: docker/Dockerfile + - ubuntu-version: ubuntu-22.04 + dockerfile: docker/ros2_ov202x/ros2_humble/Dockerfile + - ubuntu-version: ubuntu-24.04 + dockerfile: docker/ros2_ov2025/ros2_jazzy/Dockerfile # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -45,8 +55,8 @@ jobs: mkdir -p ../workspace cp -r ${GITHUB_WORKSPACE}/.ci_local_test/ros2_openvino_toolkit_test ../workspace cp -r ${GITHUB_WORKSPACE} ../workspace/ros2_openvino_toolkit_test - ls ${GITHUB_WORKSPACE}/docker/Dockerfile - cp ${GITHUB_WORKSPACE}/docker/Dockerfile ../workspace/ros2_openvino_toolkit_test + ls ${GITHUB_WORKSPACE}/${{ matrix.dockerfile }} + cp ${GITHUB_WORKSPACE}/${{ matrix.dockerfile }} ../workspace/ros2_openvino_toolkit_test/Dockerfile ls ../workspace/ros2_openvino_toolkit_test/Dockerfile cd ../workspace/ros2_openvino_toolkit_test && ./docker_run.sh diff --git a/.github/workflows/code_format.yml b/.github/workflows/code_format.yml index b12f280a..720c3c7a 100644 --- a/.github/workflows/code_format.yml +++ b/.github/workflows/code_format.yml @@ -26,18 +26,25 @@ jobs: uses: c-hive/gha-remove-artifacts@v1 with: age: '15 days' - pre-commit: + code-format-check: # The type of runner that the job will run on runs-on: ubuntu-22.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - # Runs a set of commands using the runners shell - - name: code_format_check + # Install clang-format + - name: Install clang-format + run: sudo apt-get update && sudo apt-get install clang-format -y + # Run clang-format on all C++ files + - name: Run clang-format run: | - sudo apt-get install clang-format -y - find . -name '*.h' -or -name '*.hpp' -or -name '*.cpp' | xargs clang-format -i -style=file - git diff --exit-code + find . -type f \( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) \ + ! -path "*/build/*" ! -path "*/install/*" ! -path "*/log/*" \ + -exec clang-format -i -style=file {} \; + # Check if any files were modified + - name: Check for formatting changes + run: | + git diff --exit-code || (echo "Code formatting issues detected. Please run clang-format locally." && exit 1) diff --git a/.github/workflows/ubuntu-22.04-humble.yml b/.github/workflows/ubuntu-22.04-humble.yml new file mode 100644 index 00000000..b4de22d3 --- /dev/null +++ b/.github/workflows/ubuntu-22.04-humble.yml @@ -0,0 +1,66 @@ +name: Ubuntu-22.04-Humble-CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the ros2 branch +on: + push: + branches: [ "ros2" ] + pull_request: + branches: [ "ros2" ] + +permissions: read-all + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-22.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + # install ros2 humble + - uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: humble + - run: "source /opt/ros/humble/setup.bash && ros2 run --help" + + # install openvino 2022.3 (latest compatible with ros2 branch) + - name: install openvino 2022.3 + run: | + # https://docs.openvino.ai/2022.3/openvino_docs_install_guides_installing_openvino_apt.html + sudo apt update && sudo apt install -y curl gnupg2 lsb-release + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + echo "deb https://apt.repos.intel.com/openvino/2022 jammy main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2022.list + sudo apt update + sudo apt-cache search openvino + sudo apt-get install -y openvino-2022.3.0 + ls -lh /opt/intel/openvino_2022 + source /opt/intel/openvino_2022/setupvars.sh + + # install librealsense2 + - name: install librealsense2 + run: | + # https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md + sudo mkdir -p /etc/apt/keyrings + curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null + echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo jammy main" | sudo tee /etc/apt/sources.list.d/librealsense.list + sudo apt-get update && sudo apt-get install -y librealsense2-dev librealsense2 + dpkg -l |grep realsense + + # build ros2 openvino toolkit + - name: build ros2 openvino toolkit + run: | + mkdir -p ~/ros2_ws/src + env + cp -rf ${GITHUB_WORKSPACE} ~/ros2_ws/src + cd ~/ros2_ws/src + git clone https://github.com/intel/ros2_object_msgs.git + cd ros2_object_msgs && git checkout ros2 && cd ~/ros2_ws/ + source /opt/ros/humble/setup.bash + source /opt/intel/openvino_2022/setupvars.sh + colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml new file mode 100644 index 00000000..4f70b1f3 --- /dev/null +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -0,0 +1,77 @@ +name: Ubuntu-24.04-Jazzy-CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the ros2 branch +on: + push: + branches: [ "ros2" ] + pull_request: + branches: [ "ros2" ] + +permissions: read-all + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-24.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + # install ros2 jazzy + - name: install ros2 jazzy + run: | + # https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html + sudo apt update && sudo apt install -y software-properties-common + sudo add-apt-repository universe + sudo apt update && sudo apt install -y curl gnupg lsb-release + sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null + sudo apt update + sudo apt install -y ros-jazzy-desktop ros-dev-tools + source /opt/ros/jazzy/setup.bash && ros2 run --help + + # install openvino 2025.4 + - name: install openvino 2025.4 + run: | + # https://docs.openvino.ai/2025/get-started/install-openvino/install-openvino-archive-linux.html + sudo apt update && sudo apt install -y curl wget gnupg2 lsb-release + wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4/linux/l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64.tgz + tar -xf l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64.tgz + sudo mv l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64 /opt/intel/openvino_2025 + source /opt/intel/openvino_2025/setupvars.sh + ls -lh /opt/intel/openvino_2025 + + # install librealsense2 + - name: install librealsense2 + run: | + # Build from source for Ubuntu 24.04 (no official packages yet) + sudo apt-get update && sudo apt-get install -y \ + git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config \ + libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev cmake + cd ~/ + git clone --depth 1 --branch v2.54.2 https://github.com/IntelRealSense/librealsense.git + cd librealsense + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF + make -j$(nproc) + sudo make install + sudo ldconfig + pkg-config --modversion realsense2 || echo "RealSense installed" + + # build ros2 openvino toolkit + - name: build ros2 openvino toolkit + run: | + mkdir -p ~/ros2_ws/src + env + cp -rf ${GITHUB_WORKSPACE} ~/ros2_ws/src + cd ~/ros2_ws/src + git clone https://github.com/intel/ros2_object_msgs.git + cd ros2_object_msgs && git checkout ros2 && cd ~/ros2_ws/ + source /opt/ros/jazzy/setup.bash + source /opt/intel/openvino_2025/setupvars.sh + colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp b/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp index b7d04700..efed3823 100644 --- a/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp +++ b/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp @@ -107,8 +107,8 @@ class ModelAttribute if (attr_.max_proposal_count <= 0 || attr_.object_size <= 0 || attr_.input_height <= 0 || attr_.input_width <= 0 || attr_.input_names.empty() || attr_.output_names.empty()) { slog::info << "--------" << slog::endl; - slog::warn << "Not all attributes are set correctly! not 0 or empty is allowed in" - << " the above list." << slog::endl; + slog::warn << "Not all attributes are set correctly! not 0 or empty is allowed in" << " the above list." + << slog::endl; } if (attr_.input_tensor_count != static_cast(attr_.input_names.size())) { slog::info << "--------" << slog::endl; diff --git a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/common.hpp b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/common.hpp index f2b43a77..ef6cc4bb 100644 --- a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/common.hpp +++ b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/common.hpp @@ -210,7 +210,7 @@ static UNUSED void printPerformanceCounts(ov::InferRequest request, std::ostream bool bshowHeader = true) { auto performanceMap = request.get_profiling_info(); - //printPerformanceCounts(performanceMap, stream, deviceName, bshowHeader); + // printPerformanceCounts(performanceMap, stream, deviceName, bshowHeader); } inline std::map getMapFullDevicesNames(ov::Core& core, std::vector devices) diff --git a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp index d9408994..e6a499b5 100644 --- a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp +++ b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp @@ -53,10 +53,8 @@ static std::ostream& operator<<(std::ostream& os, const ov::Version& version) { os << "\n\tAPI version ............ "; os << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH; - os << "\n\t" - << "Build .................. " << version.buildNumber; - os << "\n\t" - << "Description ............ " << version.description; + os << "\n\t" << "Build .................. " << version.buildNumber; + os << "\n\t" << "Description ............ " << version.description; return os; } diff --git a/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp b/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp index 0598df48..c8ee8de4 100644 --- a/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp @@ -105,8 +105,8 @@ const std::vector openvino_wrapper_lib::AgeGenderDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Age gender detection does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Age gender detection does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp index 876bf67e..c489b65b 100644 --- a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp +++ b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp @@ -62,9 +62,9 @@ double openvino_wrapper_lib::Tracker::calcSimilarity(const std::vector& f const std::vector& feature_b) { if (feature_a.size() != feature_b.size()) { - slog::err << "cosine similarity can't be called for vectors of different lengths: " - << "feature_a size = " << std::to_string(feature_a.size()) - << "feature_b size = " << std::to_string(feature_b.size()) << slog::endl; + slog::err << "cosine similarity can't be called for vectors of different lengths: " << "feature_a size = " + << std::to_string(feature_a.size()) << "feature_b size = " << std::to_string(feature_b.size()) + << slog::endl; } float mul_sum, denom_a, denom_b, value_a, value_b; mul_sum = denom_a = denom_b = value_a = value_b = 0; diff --git a/openvino_wrapper_lib/src/inferences/emotions_detection.cpp b/openvino_wrapper_lib/src/inferences/emotions_detection.cpp index f43aa6b2..a82067b8 100644 --- a/openvino_wrapper_lib/src/inferences/emotions_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/emotions_detection.cpp @@ -127,8 +127,8 @@ const std::vector openvino_wrapper_lib::EmotionsDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Emotion detection does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Emotion detection does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/face_reidentification.cpp b/openvino_wrapper_lib/src/inferences/face_reidentification.cpp index c308d3d9..e02f3093 100644 --- a/openvino_wrapper_lib/src/inferences/face_reidentification.cpp +++ b/openvino_wrapper_lib/src/inferences/face_reidentification.cpp @@ -114,8 +114,8 @@ const std::vector openvino_wrapper_lib::FaceReidentification::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Face reidentification does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Face reidentification does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp b/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp index 4ccde0c9..549f812e 100644 --- a/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp @@ -107,8 +107,8 @@ const std::vector openvino_wrapper_lib::HeadPoseDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Headpose detection does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Headpose detection does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp b/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp index ff1e4c12..3878ee48 100644 --- a/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp @@ -116,8 +116,8 @@ const std::vector openvino_wrapper_lib::LandmarksDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Landmarks detection does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Landmarks detection does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation.cpp index fa035a6c..3eee219d 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation.cpp @@ -209,8 +209,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentation::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; return filtered_rois; diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp index c833ad98..3342ba84 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp @@ -110,8 +110,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentationInstance::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp index 7e1dc28e..c322a0ba 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp @@ -211,8 +211,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentationMaskrcnn::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " - << "Filter conditions: " << filter_conditions << slog::endl; + slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions + << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/models/object_segmentation_model.cpp b/openvino_wrapper_lib/src/models/object_segmentation_model.cpp index 02ba172d..a9cabd15 100644 --- a/openvino_wrapper_lib/src/models/object_segmentation_model.cpp +++ b/openvino_wrapper_lib/src/models/object_segmentation_model.cpp @@ -198,8 +198,8 @@ bool Models::ObjectSegmentationModel::updateLayerProperty(std::shared_ptr" << child << "(" << child_order << ")" - << "]" << slog::endl; + slog::info << "Checking connection into pipeline:[" << parent << "(" << parent_order << ")" << "<-->" << child << "(" + << child_order << ")" << "]" << slog::endl; return (parent_order != kCatagoryOrder_Unknown) && (child_order != kCatagoryOrder_Unknown) && (parent_order <= child_order); } diff --git a/sample/include/utility.hpp b/sample/include/utility.hpp index 06674adb..ede386fa 100644 --- a/sample/include/utility.hpp +++ b/sample/include/utility.hpp @@ -15,7 +15,7 @@ #ifndef UTILITY_HPP_ #define UTILITY_HPP_ -//#include +// #include #include #include diff --git a/sample/src/image_object_server.cpp b/sample/src/image_object_server.cpp index b6dbb6e9..1aa79e59 100644 --- a/sample/src/image_object_server.cpp +++ b/sample/src/image_object_server.cpp @@ -44,8 +44,7 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [frame_processing_server]: " - << "exception caught" << std::endl; + std::cout << "[ERROR] [frame_processing_server]: " << "exception caught" << std::endl; } return 0; diff --git a/sample/src/image_people_server.cpp b/sample/src/image_people_server.cpp index 845eaee9..7ebc99fa 100644 --- a/sample/src/image_people_server.cpp +++ b/sample/src/image_people_server.cpp @@ -44,8 +44,7 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [service_people_detection]: " - << "exception caught" << std::endl; + std::cout << "[ERROR] [service_people_detection]: " << "exception caught" << std::endl; } return 0; diff --git a/sample/src/pipeline_composite.cpp b/sample/src/pipeline_composite.cpp index 959f7889..e9890384 100644 --- a/sample/src/pipeline_composite.cpp +++ b/sample/src/pipeline_composite.cpp @@ -46,7 +46,7 @@ #include "openvino/openvino.hpp" #include "librealsense2/rs.hpp" #include "opencv2/opencv.hpp" -//#include "utility.hpp" +// #include "utility.hpp" void signalHandler(int signum) { From 5a7746368158d4be08b037d29821dec869a1d35c Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 18:47:31 +0100 Subject: [PATCH 04/14] [ROS2] [Jazzy] Update OpenVINO installation to version 2024.6 for Ubuntu 22.04 and 2025.4 for Ubuntu 24.04; improve error message formatting in image processing servers --- .github/workflows/ubuntu-22.04-humble.yml | 24 +++++++++++------------ .github/workflows/ubuntu-24.04-jazzy.yml | 6 +++--- sample/src/image_object_server.cpp | 3 ++- sample/src/image_people_server.cpp | 3 ++- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ubuntu-22.04-humble.yml b/.github/workflows/ubuntu-22.04-humble.yml index b4de22d3..aa4f04fb 100644 --- a/.github/workflows/ubuntu-22.04-humble.yml +++ b/.github/workflows/ubuntu-22.04-humble.yml @@ -28,19 +28,17 @@ jobs: required-ros-distributions: humble - run: "source /opt/ros/humble/setup.bash && ros2 run --help" - # install openvino 2022.3 (latest compatible with ros2 branch) - - name: install openvino 2022.3 + # install openvino 2024.6 + - name: install openvino 2024.6 run: | - # https://docs.openvino.ai/2022.3/openvino_docs_install_guides_installing_openvino_apt.html - sudo apt update && sudo apt install -y curl gnupg2 lsb-release - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - echo "deb https://apt.repos.intel.com/openvino/2022 jammy main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2022.list - sudo apt update - sudo apt-cache search openvino - sudo apt-get install -y openvino-2022.3.0 - ls -lh /opt/intel/openvino_2022 - source /opt/intel/openvino_2022/setupvars.sh + # https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html + sudo apt update && sudo apt install -y curl wget gnupg2 lsb-release + wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_ubuntu22_2024.6.0.17404.4c0f47d2335_x86_64.tgz + tar -xf l_openvino_toolkit_ubuntu22_2024.6.0.17404.4c0f47d2335_x86_64.tgz + sudo mkdir -p /opt/intel + sudo mv l_openvino_toolkit_ubuntu22_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024 + source /opt/intel/openvino_2024/setupvars.sh + ls -lh /opt/intel/openvino_2024 # install librealsense2 - name: install librealsense2 @@ -62,5 +60,5 @@ jobs: git clone https://github.com/intel/ros2_object_msgs.git cd ros2_object_msgs && git checkout ros2 && cd ~/ros2_ws/ source /opt/ros/humble/setup.bash - source /opt/intel/openvino_2022/setupvars.sh + source /opt/intel/openvino_2024/setupvars.sh colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml index 4f70b1f3..16ab8c75 100644 --- a/.github/workflows/ubuntu-24.04-jazzy.yml +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -40,9 +40,9 @@ jobs: run: | # https://docs.openvino.ai/2025/get-started/install-openvino/install-openvino-archive-linux.html sudo apt update && sudo apt install -y curl wget gnupg2 lsb-release - wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4/linux/l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64.tgz - tar -xf l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64.tgz - sudo mv l_openvino_toolkit_ubuntu24_2025.4.0.17622.dd9a450d32f_x86_64 /opt/intel/openvino_2025 + wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4/linux/openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz + tar -xf l_openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz + sudo mv l_openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64 /opt/intel/openvino_2025 source /opt/intel/openvino_2025/setupvars.sh ls -lh /opt/intel/openvino_2025 diff --git a/sample/src/image_object_server.cpp b/sample/src/image_object_server.cpp index 1aa79e59..4648809b 100644 --- a/sample/src/image_object_server.cpp +++ b/sample/src/image_object_server.cpp @@ -44,7 +44,8 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [frame_processing_server]: " << "exception caught" << std::endl; + std::cout << "[ERROR] [frame_processing_server]: " + << "exception caught" << std::endl; } return 0; diff --git a/sample/src/image_people_server.cpp b/sample/src/image_people_server.cpp index 7ebc99fa..a1895978 100644 --- a/sample/src/image_people_server.cpp +++ b/sample/src/image_people_server.cpp @@ -44,7 +44,8 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [service_people_detection]: " << "exception caught" << std::endl; + std::cout << "[ERROR] [service_people_detection]: " + << "exception caught" << std::endl; } return 0; From c8471aff89dae145bc428aa15b6c6f27871c89a1 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 19:37:44 +0100 Subject: [PATCH 05/14] [ROS2] [Jazzy] Update OpenVINO installation steps for Ubuntu 24.04 and improve error message formatting in image processing servers --- .github/workflows/ubuntu-24.04-jazzy.yml | 5 +++-- sample/src/image_object_server.cpp | 2 +- sample/src/image_people_server.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml index 16ab8c75..0e827736 100644 --- a/.github/workflows/ubuntu-24.04-jazzy.yml +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -41,8 +41,9 @@ jobs: # https://docs.openvino.ai/2025/get-started/install-openvino/install-openvino-archive-linux.html sudo apt update && sudo apt install -y curl wget gnupg2 lsb-release wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4/linux/openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz - tar -xf l_openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz - sudo mv l_openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64 /opt/intel/openvino_2025 + tar -xf openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz + sudo mkdir -p /opt/intel + sudo mv openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64 /opt/intel/openvino_2025 source /opt/intel/openvino_2025/setupvars.sh ls -lh /opt/intel/openvino_2025 diff --git a/sample/src/image_object_server.cpp b/sample/src/image_object_server.cpp index 4648809b..b6dbb6e9 100644 --- a/sample/src/image_object_server.cpp +++ b/sample/src/image_object_server.cpp @@ -44,7 +44,7 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [frame_processing_server]: " + std::cout << "[ERROR] [frame_processing_server]: " << "exception caught" << std::endl; } diff --git a/sample/src/image_people_server.cpp b/sample/src/image_people_server.cpp index a1895978..845eaee9 100644 --- a/sample/src/image_people_server.cpp +++ b/sample/src/image_people_server.cpp @@ -44,7 +44,7 @@ int main(int argc, char** argv) } catch (std::exception& e) { std::cout << e.what() << std::endl; } catch (...) { - std::cout << "[ERROR] [service_people_detection]: " + std::cout << "[ERROR] [service_people_detection]: " << "exception caught" << std::endl; } From a7c431a9db779be188cfda20f651c7b825577f2b Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 20:16:39 +0100 Subject: [PATCH 06/14] [ROS2] [Jazzy] Update librealsense version to 2.57.5 in CI workflows and Dockerfile; improve logging format in inference modules --- .github/workflows/code_format.yml | 40 ++++++------------- .github/workflows/ubuntu-24.04-jazzy.yml | 2 +- docker/ros2_ov2025/ros2_jazzy/Dockerfile | 2 +- .../models/attributes/base_attribute.hpp | 4 +- .../utils/version_info.hpp | 6 ++- .../src/inferences/age_gender_detection.cpp | 4 +- .../src/inferences/base_reidentification.cpp | 6 +-- .../src/inferences/emotions_detection.cpp | 4 +- .../src/inferences/face_reidentification.cpp | 4 +- .../src/inferences/head_pose_detection.cpp | 4 +- .../src/inferences/landmarks_detection.cpp | 4 +- .../src/inferences/object_segmentation.cpp | 4 +- .../object_segmentation_instance.cpp | 4 +- .../object_segmentation_maskrcnn.cpp | 4 +- .../src/models/object_segmentation_model.cpp | 4 +- openvino_wrapper_lib/src/pipeline.cpp | 5 ++- 16 files changed, 44 insertions(+), 57 deletions(-) diff --git a/.github/workflows/code_format.yml b/.github/workflows/code_format.yml index 720c3c7a..b8be3787 100644 --- a/.github/workflows/code_format.yml +++ b/.github/workflows/code_format.yml @@ -1,50 +1,34 @@ name: Code_Format_Check -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the "master" branch push: branches: [ "master", "ros2" ] pull_request: branches: [ "master", "ros2" ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: contents: read -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # Removed the old artifacts - remove-old-artifacts: - runs-on: ubuntu-22.04 - timeout-minutes: 10 - steps: - - name: Remove old artifacts - uses: c-hive/gha-remove-artifacts@v1 - with: - age: '15 days' code-format-check: - # The type of runner that the job will run on runs-on: ubuntu-22.04 - # Steps represent a sequence of tasks that will be executed as part of the job + timeout-minutes: 10 + steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - # Install clang-format + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install clang-format - run: sudo apt-get update && sudo apt-get install clang-format -y - # Run clang-format on all C++ files - - name: Run clang-format run: | - find . -type f \( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) \ - ! -path "*/build/*" ! -path "*/install/*" ! -path "*/log/*" \ - -exec clang-format -i -style=file {} \; - # Check if any files were modified - - name: Check for formatting changes + sudo apt-get update + sudo apt-get install -y clang-format-14 + + - name: Run clang-format check run: | - git diff --exit-code || (echo "Code formatting issues detected. Please run clang-format locally." && exit 1) + FILES=$(find . -type f \( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) \ + ! -path "*/build/*" ! -path "*/install/*" ! -path "*/log/*") + clang-format --dry-run --Werror -style=file $FILES diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml index 0e827736..5e924d01 100644 --- a/.github/workflows/ubuntu-24.04-jazzy.yml +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -55,7 +55,7 @@ jobs: git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config \ libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev cmake cd ~/ - git clone --depth 1 --branch v2.54.2 https://github.com/IntelRealSense/librealsense.git + git clone --depth 1 --branch v2.57.5 https://github.com/IntelRealSense/librealsense.git cd librealsense mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF diff --git a/docker/ros2_ov2025/ros2_jazzy/Dockerfile b/docker/ros2_ov2025/ros2_jazzy/Dockerfile index ffaf08eb..14890044 100644 --- a/docker/ros2_ov2025/ros2_jazzy/Dockerfile +++ b/docker/ros2_ov2025/ros2_jazzy/Dockerfile @@ -31,7 +31,7 @@ RUN apt update && \ # Build librealsense2 WORKDIR /root/ -RUN git clone --branch v2.55.1 --single-branch https://github.com/IntelRealSense/librealsense.git && \ +RUN git clone --branch v2.57.5 --single-branch https://github.com/IntelRealSense/librealsense.git && \ cd librealsense && \ mkdir build && \ cd build && \ diff --git a/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp b/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp index efed3823..b7d04700 100644 --- a/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp +++ b/openvino_wrapper_lib/include/openvino_wrapper_lib/models/attributes/base_attribute.hpp @@ -107,8 +107,8 @@ class ModelAttribute if (attr_.max_proposal_count <= 0 || attr_.object_size <= 0 || attr_.input_height <= 0 || attr_.input_width <= 0 || attr_.input_names.empty() || attr_.output_names.empty()) { slog::info << "--------" << slog::endl; - slog::warn << "Not all attributes are set correctly! not 0 or empty is allowed in" << " the above list." - << slog::endl; + slog::warn << "Not all attributes are set correctly! not 0 or empty is allowed in" + << " the above list." << slog::endl; } if (attr_.input_tensor_count != static_cast(attr_.input_names.size())) { slog::info << "--------" << slog::endl; diff --git a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp index e6a499b5..d9408994 100644 --- a/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp +++ b/openvino_wrapper_lib/include/openvino_wrapper_lib/utils/version_info.hpp @@ -53,8 +53,10 @@ static std::ostream& operator<<(std::ostream& os, const ov::Version& version) { os << "\n\tAPI version ............ "; os << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH; - os << "\n\t" << "Build .................. " << version.buildNumber; - os << "\n\t" << "Description ............ " << version.description; + os << "\n\t" + << "Build .................. " << version.buildNumber; + os << "\n\t" + << "Description ............ " << version.description; return os; } diff --git a/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp b/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp index c8ee8de4..0598df48 100644 --- a/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/age_gender_detection.cpp @@ -105,8 +105,8 @@ const std::vector openvino_wrapper_lib::AgeGenderDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Age gender detection does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Age gender detection does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp index c489b65b..876bf67e 100644 --- a/openvino_wrapper_lib/src/inferences/base_reidentification.cpp +++ b/openvino_wrapper_lib/src/inferences/base_reidentification.cpp @@ -62,9 +62,9 @@ double openvino_wrapper_lib::Tracker::calcSimilarity(const std::vector& f const std::vector& feature_b) { if (feature_a.size() != feature_b.size()) { - slog::err << "cosine similarity can't be called for vectors of different lengths: " << "feature_a size = " - << std::to_string(feature_a.size()) << "feature_b size = " << std::to_string(feature_b.size()) - << slog::endl; + slog::err << "cosine similarity can't be called for vectors of different lengths: " + << "feature_a size = " << std::to_string(feature_a.size()) + << "feature_b size = " << std::to_string(feature_b.size()) << slog::endl; } float mul_sum, denom_a, denom_b, value_a, value_b; mul_sum = denom_a = denom_b = value_a = value_b = 0; diff --git a/openvino_wrapper_lib/src/inferences/emotions_detection.cpp b/openvino_wrapper_lib/src/inferences/emotions_detection.cpp index a82067b8..f43aa6b2 100644 --- a/openvino_wrapper_lib/src/inferences/emotions_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/emotions_detection.cpp @@ -127,8 +127,8 @@ const std::vector openvino_wrapper_lib::EmotionsDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Emotion detection does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Emotion detection does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/face_reidentification.cpp b/openvino_wrapper_lib/src/inferences/face_reidentification.cpp index e02f3093..c308d3d9 100644 --- a/openvino_wrapper_lib/src/inferences/face_reidentification.cpp +++ b/openvino_wrapper_lib/src/inferences/face_reidentification.cpp @@ -114,8 +114,8 @@ const std::vector openvino_wrapper_lib::FaceReidentification::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Face reidentification does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Face reidentification does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp b/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp index 549f812e..4ccde0c9 100644 --- a/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/head_pose_detection.cpp @@ -107,8 +107,8 @@ const std::vector openvino_wrapper_lib::HeadPoseDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Headpose detection does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Headpose detection does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp b/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp index 3878ee48..ff1e4c12 100644 --- a/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp +++ b/openvino_wrapper_lib/src/inferences/landmarks_detection.cpp @@ -116,8 +116,8 @@ const std::vector openvino_wrapper_lib::LandmarksDetection::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Landmarks detection does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Landmarks detection does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation.cpp index 3eee219d..fa035a6c 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation.cpp @@ -209,8 +209,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentation::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Object segmentation does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; return filtered_rois; diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp index 3342ba84..c833ad98 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation_instance.cpp @@ -110,8 +110,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentationInstance::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Object segmentation does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp b/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp index c322a0ba..7e1dc28e 100644 --- a/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp +++ b/openvino_wrapper_lib/src/inferences/object_segmentation_maskrcnn.cpp @@ -211,8 +211,8 @@ const std::vector openvino_wrapper_lib::ObjectSegmentationMaskrcnn::getFilteredROIs(const std::string filter_conditions) const { if (!filter_conditions.empty()) { - slog::err << "Object segmentation does not support filtering now! " << "Filter conditions: " << filter_conditions - << slog::endl; + slog::err << "Object segmentation does not support filtering now! " + << "Filter conditions: " << filter_conditions << slog::endl; } std::vector filtered_rois; for (auto res : results_) { diff --git a/openvino_wrapper_lib/src/models/object_segmentation_model.cpp b/openvino_wrapper_lib/src/models/object_segmentation_model.cpp index a9cabd15..02ba172d 100644 --- a/openvino_wrapper_lib/src/models/object_segmentation_model.cpp +++ b/openvino_wrapper_lib/src/models/object_segmentation_model.cpp @@ -198,8 +198,8 @@ bool Models::ObjectSegmentationModel::updateLayerProperty(std::shared_ptr" << child << "(" - << child_order << ")" << "]" << slog::endl; + slog::info << "Checking connection into pipeline:[" << parent << "(" << parent_order << ")" + << "<-->" << child << "(" << child_order << ")" + << "]" << slog::endl; return (parent_order != kCatagoryOrder_Unknown) && (child_order != kCatagoryOrder_Unknown) && (parent_order <= child_order); } From 3ceacc59b5696273afcaeaf3e78fd372208d9f13 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 20:59:44 +0100 Subject: [PATCH 07/14] [ROS2] [Jazzy] Update Docker run script to remove specific git clone commands and dynamically detect ROS distribution; enhance CI workflows for Ubuntu 22.04 and 24.04 --- .../ros2_openvino_toolkit_test/docker_run.sh | 23 +++++++++++++-- .github/workflows/ubuntu-22.04-humble.yml | 17 +++-------- .github/workflows/ubuntu-24.04-jazzy.yml | 28 ++++--------------- 3 files changed, 30 insertions(+), 38 deletions(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index b1ba19a8..89d64155 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -19,12 +19,29 @@ function run_container() # Removing some docker image .. # Using jenkins server ros2_openvino_toolkit code instead of git clone code. cd "$work_dir" && sed -i '/RUN git clone -b ros2/d' Dockerfile + cd "$work_dir" && sed -i '/RUN git clone -b ros2_jazzy/d' Dockerfile # add the jpg for test. - cd "$work_dir" && sed -i '$i COPY jpg /root/jpg' Dockerfile + cd "$work_dir" && sed -i '/^WORKDIR \/root\/ros2_ws$/a COPY jpg /root/jpg' Dockerfile || \ + cd "$work_dir" && sed -i '/^WORKDIR \/root\/catkin_ws$/a COPY jpg /root/jpg' Dockerfile - cd "$work_dir" && docker build --build-arg ROS_PRE_INSTALLED_PKG=galactic-desktop --build-arg VERSION=galactic -t ros2_openvino_docker:01 . + # Detect ROS distro from Dockerfile + if grep -q "ros:jazzy" Dockerfile; then + ROS_DISTRO="jazzy" + WORKSPACE_DIR="ros2_ws" + elif grep -q "ros:humble" Dockerfile; then + ROS_DISTRO="humble" + WORKSPACE_DIR="ros2_ws" + elif grep -q "ros:galactic" Dockerfile; then + ROS_DISTRO="galactic" + WORKSPACE_DIR="catkin_ws" + else + ROS_DISTRO="galactic" + WORKSPACE_DIR="catkin_ws" + fi + + cd "$work_dir" && docker build --build-arg ROS_PRE_INSTALLED_PKG=${ROS_DISTRO}-desktop --build-arg VERSION=${ROS_DISTRO} -t ros2_openvino_docker:01 . cd "$work_dir" && docker images - docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/catkin_ws/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh galactic" + docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" } if ! run_container; then diff --git a/.github/workflows/ubuntu-22.04-humble.yml b/.github/workflows/ubuntu-22.04-humble.yml index aa4f04fb..a772fca9 100644 --- a/.github/workflows/ubuntu-22.04-humble.yml +++ b/.github/workflows/ubuntu-22.04-humble.yml @@ -1,7 +1,5 @@ name: Ubuntu-22.04-Humble-CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the ros2 branch on: push: branches: [ "ros2" ] @@ -10,25 +8,20 @@ on: permissions: read-all -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-22.04 - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - # install ros2 humble - - uses: ros-tooling/setup-ros@v0.7 + - name: install ros2 humble + uses: ros-tooling/setup-ros@v0.7 with: required-ros-distributions: humble - run: "source /opt/ros/humble/setup.bash && ros2 run --help" - # install openvino 2024.6 - name: install openvino 2024.6 run: | # https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html @@ -40,7 +33,6 @@ jobs: source /opt/intel/openvino_2024/setupvars.sh ls -lh /opt/intel/openvino_2024 - # install librealsense2 - name: install librealsense2 run: | # https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md @@ -50,7 +42,6 @@ jobs: sudo apt-get update && sudo apt-get install -y librealsense2-dev librealsense2 dpkg -l |grep realsense - # build ros2 openvino toolkit - name: build ros2 openvino toolkit run: | mkdir -p ~/ros2_ws/src diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml index 5e924d01..9b0da220 100644 --- a/.github/workflows/ubuntu-24.04-jazzy.yml +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -1,7 +1,5 @@ name: Ubuntu-24.04-Jazzy-CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the ros2 branch on: push: branches: [ "ros2" ] @@ -10,32 +8,20 @@ on: permissions: read-all -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-24.04 - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - # install ros2 jazzy - name: install ros2 jazzy - run: | - # https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html - sudo apt update && sudo apt install -y software-properties-common - sudo add-apt-repository universe - sudo apt update && sudo apt install -y curl gnupg lsb-release - sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - sudo apt update - sudo apt install -y ros-jazzy-desktop ros-dev-tools - source /opt/ros/jazzy/setup.bash && ros2 run --help + uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: jazzy + - run: "source /opt/ros/jazzy/setup.bash && ros2 run --help" - # install openvino 2025.4 - name: install openvino 2025.4 run: | # https://docs.openvino.ai/2025/get-started/install-openvino/install-openvino-archive-linux.html @@ -47,7 +33,6 @@ jobs: source /opt/intel/openvino_2025/setupvars.sh ls -lh /opt/intel/openvino_2025 - # install librealsense2 - name: install librealsense2 run: | # Build from source for Ubuntu 24.04 (no official packages yet) @@ -64,7 +49,6 @@ jobs: sudo ldconfig pkg-config --modversion realsense2 || echo "RealSense installed" - # build ros2 openvino toolkit - name: build ros2 openvino toolkit run: | mkdir -p ~/ros2_ws/src From 8287b6ea9e48d48f91b65a5081bf31472fb9be94 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 21:17:30 +0100 Subject: [PATCH 08/14] Fix CI test scripts for multi-distro support - Update config.sh to detect workspace dir (ros2_ws vs catkin_ws) based on ROS distro - Update run.sh to use WORKSPACE_DIR variable instead of hardcoded /root/catkin_ws - Add --break-system-packages flag for pip install (Ubuntu 24.04 requirement) - Add code_format.yml workflow description comment Fixes test failures for Jazzy and Humble distros --- .../test_cases/config.sh | 9 ++++++- .../test_cases/run.sh | 6 ++--- .github/workflows/basic_func_tests.yml | 27 +++++-------------- .github/workflows/code_format.yml | 1 + 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/config.sh b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/config.sh index 0efee6ce..7b67d03e 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/config.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/config.sh @@ -7,7 +7,14 @@ else export ros2_branch=$1 fi -export dynamic_vino_sample=/root/catkin_ws/install/openvino_node/share/openvino_node +# Detect workspace directory based on ROS distro +if [[ "$ros2_branch" == "jazzy" ]] || [[ "$ros2_branch" == "humble" ]]; then + export WORKSPACE_DIR=/root/ros2_ws +else + export WORKSPACE_DIR=/root/catkin_ws +fi + +export dynamic_vino_sample=${WORKSPACE_DIR}/install/openvino_node/share/openvino_node source /opt/ros/$ros2_branch/setup.bash diff --git a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh index 8e0af8c8..b5f45f25 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh @@ -10,7 +10,7 @@ fi #shellcheck source=/dev/null source /root/test_cases/config.sh "$ros2_branch" -cd /root/catkin_ws && colcon build --symlink-install +cd ${WORKSPACE_DIR} && colcon build --symlink-install # shellcheck source=/dev/null source ./install/local_setup.bash @@ -18,12 +18,12 @@ apt-get update # apt-get install -y ros-$ros2_branch-diagnostic-updater apt-get install python3-defusedxml apt-get install -y python3-pip -pip3 install XTestRunner==1.5.0 +pip3 install XTestRunner==1.5.0 --break-system-packages cd /root/test_cases && ./ros2_openvino_tool_model_download.sh mkdir -p /root/test_cases/log echo "===cat pipeline_people_ci.yaml" -cat /root/catkin_ws/install/openvino_node/share/openvino_node/param/pipeline_people_ci.yaml +cat ${WORKSPACE_DIR}/install/openvino_node/share/openvino_node/param/pipeline_people_ci.yaml cd /root/test_cases/unittest && python3 run_all.py result=$? diff --git a/.github/workflows/basic_func_tests.yml b/.github/workflows/basic_func_tests.yml index a5f49710..cbbfef84 100644 --- a/.github/workflows/basic_func_tests.yml +++ b/.github/workflows/basic_func_tests.yml @@ -1,35 +1,20 @@ -# This is a basic workflow to help you get started with Actions +# GitHub Actions workflow file to run basic functional tests for ros2_openvino_toolkit on multiple Ubuntu versions name: Basic_Func_CI -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the "master" branch push: branches: [ "master", "ros2" ] pull_request: branches: [ "master", "ros2" ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: permissions: contents: read -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # Removed the old artifacts - remove-old-artifacts: - runs-on: ubuntu-20.04 - timeout-minutes: 10 - steps: - - name: Remove old artifacts - uses: c-hive/gha-remove-artifacts@v1 - with: - age: '15 days' - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on + runs-on: ${{ matrix.ubuntu-version }} strategy: matrix: @@ -41,11 +26,11 @@ jobs: dockerfile: docker/ros2_ov202x/ros2_humble/Dockerfile - ubuntu-version: ubuntu-24.04 dockerfile: docker/ros2_ov2025/ros2_jazzy/Dockerfile - # Steps represent a sequence of tasks that will be executed as part of the job + steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - # Runs a set of commands using the runners shell + - name: Checkout repository + uses: actions/checkout@v4 + - name: ros2_openvino_toolkit_test run: | df -h diff --git a/.github/workflows/code_format.yml b/.github/workflows/code_format.yml index b8be3787..620fbdd2 100644 --- a/.github/workflows/code_format.yml +++ b/.github/workflows/code_format.yml @@ -1,3 +1,4 @@ +# This workflow checks code formatting using clang-format on push and pull request events to the master and ros2 branches. name: Code_Format_Check From a95d3e736014e8695546367f2813d265d1dfc183 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 21:40:53 +0100 Subject: [PATCH 09/14] Fix permission denied error for test_cases mount in CI --- .ci_local_test/ros2_openvino_toolkit_test/docker_run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index 89d64155..200e2dc2 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -41,6 +41,10 @@ function run_container() cd "$work_dir" && docker build --build-arg ROS_PRE_INSTALLED_PKG=${ROS_DISTRO}-desktop --build-arg VERSION=${ROS_DISTRO} -t ros2_openvino_docker:01 . cd "$work_dir" && docker images + + # Ensure test_cases directory and scripts have proper permissions + chmod -R 755 "$work_dir"/test_cases + docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" } From ce240dcddf0230aed0001e29de2e886242c5ab13 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 21:52:04 +0100 Subject: [PATCH 10/14] Fix CI permission issue: chown test_cases inside container --- .ci_local_test/ros2_openvino_toolkit_test/docker_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index 200e2dc2..5f955a5b 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -45,7 +45,7 @@ function run_container() # Ensure test_cases directory and scripts have proper permissions chmod -R 755 "$work_dir"/test_cases - docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" + docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "chown -R root:root /root/test_cases && cd /root/test_cases && ./run.sh ${ROS_DISTRO}" } if ! run_container; then From ef8de17bf0e380b98816322b5841649844efc8fa Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 21:59:55 +0100 Subject: [PATCH 11/14] Use docker cp instead of mount for test_cases, disable fail-fast in matrix --- .ci_local_test/ros2_openvino_toolkit_test/docker_run.sh | 5 ++++- .github/workflows/basic_func_tests.yml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index 5f955a5b..5418f904 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -45,7 +45,10 @@ function run_container() # Ensure test_cases directory and scripts have proper permissions chmod -R 755 "$work_dir"/test_cases - docker run -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE -v "$work_dir"/test_cases:/root/test_cases --name ros2_openvino_container ros2_openvino_docker:01 bash -c "chown -R root:root /root/test_cases && cd /root/test_cases && ./run.sh ${ROS_DISTRO}" + # Create container and copy test files instead of mounting to avoid permission issues + docker create -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" + docker cp "$work_dir"/test_cases ros2_openvino_container:/root/ + docker start -ai ros2_openvino_container } if ! run_container; then diff --git a/.github/workflows/basic_func_tests.yml b/.github/workflows/basic_func_tests.yml index cbbfef84..ef9f689d 100644 --- a/.github/workflows/basic_func_tests.yml +++ b/.github/workflows/basic_func_tests.yml @@ -17,6 +17,7 @@ jobs: runs-on: ${{ matrix.ubuntu-version }} strategy: + fail-fast: false matrix: ubuntu-version: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] include: From e85d8da21924d3876463a826fbd64712c1bcbe2a Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 22:40:17 +0100 Subject: [PATCH 12/14] Fix docker_run.sh to preserve vision_opencv git clone in Dockerfile --- .ci_local_test/ros2_openvino_toolkit_test/docker_run.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index 5418f904..50b43c9e 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -16,10 +16,9 @@ function run_container() docker rm -f ros2_openvino_container fi - # Removing some docker image .. - # Using jenkins server ros2_openvino_toolkit code instead of git clone code. - cd "$work_dir" && sed -i '/RUN git clone -b ros2/d' Dockerfile - cd "$work_dir" && sed -i '/RUN git clone -b ros2_jazzy/d' Dockerfile + # Removing ros2_openvino_toolkit git clone from Dockerfile + # We'll copy it from the host instead (to test local changes) + cd "$work_dir" && sed -i '/RUN git clone.*ros2_openvino_toolkit/d' Dockerfile # add the jpg for test. cd "$work_dir" && sed -i '/^WORKDIR \/root\/ros2_ws$/a COPY jpg /root/jpg' Dockerfile || \ cd "$work_dir" && sed -i '/^WORKDIR \/root\/catkin_ws$/a COPY jpg /root/jpg' Dockerfile From a712ed655757e62aab8d61a92efe4d43388fbb51 Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 23:01:31 +0100 Subject: [PATCH 13/14] Refactor docker_run.sh and run.sh for improved container handling and build process --- .../ros2_openvino_toolkit_test/docker_run.sh | 28 ++++++++++++++----- .../test_cases/run.sh | 6 ++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh index 50b43c9e..2716b11d 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/docker_run.sh @@ -5,13 +5,13 @@ export work_dir=$PWD function run_container() { - if docker images -q ros2_openvino_docker:01 &>/dev/null; then + if [ -n "$(docker images -q ros2_openvino_docker:01)" ]; then echo "The container ros2_openvino_docker:01 image exists" docker rmi -f ros2_openvino_docker:01 fi docker ps -a | grep ros2_openvino_container - if docker ps -aq -f name=ros2_openvino_container; then + if [ -n "$(docker ps -aq -f name=ros2_openvino_container)" ]; then echo "The container ros2_openvino_container exists. Removing the container..." docker rm -f ros2_openvino_container fi @@ -41,13 +41,27 @@ function run_container() cd "$work_dir" && docker build --build-arg ROS_PRE_INSTALLED_PKG=${ROS_DISTRO}-desktop --build-arg VERSION=${ROS_DISTRO} -t ros2_openvino_docker:01 . cd "$work_dir" && docker images - # Ensure test_cases directory and scripts have proper permissions - chmod -R 755 "$work_dir"/test_cases + # Create container in detached mode + docker create -i --privileged=true --device=/dev/dri \ + -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit \ + -v "$HOME"/.Xauthority:/root/.Xauthority \ + -e GDK_SCALE \ + --name ros2_openvino_container \ + ros2_openvino_docker:01 \ + bash - # Create container and copy test files instead of mounting to avoid permission issues - docker create -i --privileged=true --device=/dev/dri -v "$work_dir"/ros2_openvino_toolkit:/root/${WORKSPACE_DIR}/src/ros2_openvino_toolkit -v "$HOME"/.Xauthority:/root/.Xauthority -e GDK_SCALE --name ros2_openvino_container ros2_openvino_docker:01 bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" + # Copy test files into container docker cp "$work_dir"/test_cases ros2_openvino_container:/root/ - docker start -ai ros2_openvino_container + + # Start container and fix permissions inside (critical for GitHub Actions) + docker start ros2_openvino_container + docker exec ros2_openvino_container chmod -R a+rx /root/test_cases + + # Run tests + docker exec -i ros2_openvino_container bash -c "cd /root/test_cases && ./run.sh ${ROS_DISTRO}" + + # Stop container (keeps it for debugging) + docker stop ros2_openvino_container } if ! run_container; then diff --git a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh index b5f45f25..b924811f 100755 --- a/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh +++ b/.ci_local_test/ros2_openvino_toolkit_test/test_cases/run.sh @@ -10,13 +10,15 @@ fi #shellcheck source=/dev/null source /root/test_cases/config.sh "$ros2_branch" -cd ${WORKSPACE_DIR} && colcon build --symlink-install +# Clean build artifacts to avoid symlink conflicts +cd ${WORKSPACE_DIR} && rm -rf build install log +cd ${WORKSPACE_DIR} && colcon build # shellcheck source=/dev/null source ./install/local_setup.bash apt-get update # apt-get install -y ros-$ros2_branch-diagnostic-updater -apt-get install python3-defusedxml +apt-get install -y python3-defusedxml apt-get install -y python3-pip pip3 install XTestRunner==1.5.0 --break-system-packages From ae6f94a06aebf591b3bec49973e41e3bde2ceb6a Mon Sep 17 00:00:00 2001 From: jb-balaji Date: Fri, 9 Jan 2026 23:59:05 +0100 Subject: [PATCH 14/14] Update CI workflows and Dockerfiles to use new librealsense repository --- .github/workflows/basic_func_tests.yml | 4 +--- .github/workflows/ubuntu-22.04-humble.yml | 6 +++--- .github/workflows/ubuntu-24.04-jazzy.yml | 19 ++++++------------- docker/ros2_ov2025/ros2_jazzy/Dockerfile | 16 +++++----------- docker/ros2_ov202x/ros2_humble/Dockerfile | 4 ++-- 5 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/basic_func_tests.yml b/.github/workflows/basic_func_tests.yml index ef9f689d..8b1767f9 100644 --- a/.github/workflows/basic_func_tests.yml +++ b/.github/workflows/basic_func_tests.yml @@ -19,10 +19,8 @@ jobs: strategy: fail-fast: false matrix: - ubuntu-version: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + ubuntu-version: [ubuntu-22.04, ubuntu-24.04] include: - - ubuntu-version: ubuntu-20.04 - dockerfile: docker/Dockerfile - ubuntu-version: ubuntu-22.04 dockerfile: docker/ros2_ov202x/ros2_humble/Dockerfile - ubuntu-version: ubuntu-24.04 diff --git a/.github/workflows/ubuntu-22.04-humble.yml b/.github/workflows/ubuntu-22.04-humble.yml index a772fca9..f7c89f0a 100644 --- a/.github/workflows/ubuntu-22.04-humble.yml +++ b/.github/workflows/ubuntu-22.04-humble.yml @@ -37,9 +37,9 @@ jobs: run: | # https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md sudo mkdir -p /etc/apt/keyrings - curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null - echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo jammy main" | sudo tee /etc/apt/sources.list.d/librealsense.list - sudo apt-get update && sudo apt-get install -y librealsense2-dev librealsense2 + curl -sSf https://librealsense.realsenseai.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null + echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.realsenseai.com/Debian/apt-repo `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/librealsense.list + sudo apt-get update && sudo apt-get install -y librealsense2-dev librealsense2-utils dpkg -l |grep realsense - name: build ros2 openvino toolkit diff --git a/.github/workflows/ubuntu-24.04-jazzy.yml b/.github/workflows/ubuntu-24.04-jazzy.yml index 9b0da220..e07db55d 100644 --- a/.github/workflows/ubuntu-24.04-jazzy.yml +++ b/.github/workflows/ubuntu-24.04-jazzy.yml @@ -35,19 +35,12 @@ jobs: - name: install librealsense2 run: | - # Build from source for Ubuntu 24.04 (no official packages yet) - sudo apt-get update && sudo apt-get install -y \ - git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config \ - libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev cmake - cd ~/ - git clone --depth 1 --branch v2.57.5 https://github.com/IntelRealSense/librealsense.git - cd librealsense - mkdir build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_GRAPHICAL_EXAMPLES=OFF - make -j$(nproc) - sudo make install - sudo ldconfig - pkg-config --modversion realsense2 || echo "RealSense installed" + # Install from Intel apt repository for Ubuntu 24.04 (noble) + sudo mkdir -p /etc/apt/keyrings + curl -sSf https://librealsense.realsenseai.com/Debian/librealsense.pgp | sudo tee /etc/apt/keyrings/librealsense.pgp > /dev/null + echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.realsenseai.com/Debian/apt-repo `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/librealsense.list + sudo apt-get update + sudo apt-get install -y librealsense2-dev librealsense2-utils - name: build ros2 openvino toolkit run: | diff --git a/docker/ros2_ov2025/ros2_jazzy/Dockerfile b/docker/ros2_ov2025/ros2_jazzy/Dockerfile index 14890044..7468d4d0 100644 --- a/docker/ros2_ov2025/ros2_jazzy/Dockerfile +++ b/docker/ros2_ov2025/ros2_jazzy/Dockerfile @@ -25,20 +25,14 @@ RUN apt update && \ # Add OpenVINO GPG key and repository wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /etc/apt/trusted.gpg.d/intel.gpg && \ echo "deb https://apt.repos.intel.com/openvino ubuntu24 main" | tee /etc/apt/sources.list.d/intel-openvino.list && \ + # Add librealsense GPG key and repository + mkdir -p /etc/apt/keyrings && \ + curl -sSf https://librealsense.realsenseai.com/Debian/librealsense.pgp | gpg --dearmor -o /etc/apt/keyrings/librealsense.pgp && \ + echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.realsenseai.com/Debian/apt-repo `lsb_release -cs` main" | tee /etc/apt/sources.list.d/librealsense.list && \ apt update && \ - apt-get install -y openvino-2025.4.0 && \ + apt-get install -y openvino-2025.4.0 librealsense2-dev librealsense2-utils && \ rm -rf /var/lib/apt/lists/* -# Build librealsense2 -WORKDIR /root/ -RUN git clone --branch v2.57.5 --single-branch https://github.com/IntelRealSense/librealsense.git && \ - cd librealsense && \ - mkdir build && \ - cd build && \ - cmake ../ && \ - make uninstall && make clean && make -j7 && make install && \ - rm -rf /root/librealsense - # build ros2 openvino toolkit WORKDIR /root RUN mkdir -p ros2_ws/src diff --git a/docker/ros2_ov202x/ros2_humble/Dockerfile b/docker/ros2_ov202x/ros2_humble/Dockerfile index 0a42c79c..81536a0b 100644 --- a/docker/ros2_ov202x/ros2_humble/Dockerfile +++ b/docker/ros2_ov202x/ros2_humble/Dockerfile @@ -38,8 +38,8 @@ RUN apt update && \ # install librealsense2 # Reference : https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md RUN mkdir -p /etc/apt/keyrings && \ - curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | tee /etc/apt/keyrings/librealsense.pgp > /dev/null && \ - echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ + curl -sSf https://librealsense.realsenseai.com/Debian/librealsense.pgp | tee /etc/apt/keyrings/librealsense.pgp > /dev/null && \ + echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.realsenseai.com/Debian/apt-repo `lsb_release -cs` main" | \ tee /etc/apt/sources.list.d/librealsense.list && \ apt-get update && \ apt-get install -y --no-install-recommends \