Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docker/ros2_ov2025/ros2_jazzy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

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
Comment on lines +47 to +48
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a personal GitHub repository 'jb-balaji/ros2_openvino_toolkit' instead of the official Intel repository may introduce maintenance and reliability concerns for production use.

Suggested change
#change the branch before merge
RUN git clone -b ros2_jazzy https://github.com/jb-balaji/ros2_openvino_toolkit.git
# Use the official Intel repository for ros2_openvino_toolkit
RUN git clone https://github.com/intel/ros2_openvino_toolkit.git

Copilot uses AI. Check for mistakes.
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
113 changes: 113 additions & 0 deletions docker/ros2_ov2025/ros2_jazzy/docker_instructions.md
Original file line number Diff line number Diff line change
@@ -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://<your-proxy.com>:<your-port>" -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.</br>
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 <ros2-ws>/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.
10 changes: 7 additions & 3 deletions docker/ros2_ov202x/ros2_humble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ LABEL maintainer="Jayabalaji Sathiyamoorthi <[email protected]

SHELL ["/bin/bash", "-c"]

# Define build argument for OpenVINO version (2025.0.0 , 2024.6.0, 2023.3.0)
ARG OPENVINO_VERSION=2025.0.0
# Define build argument for OpenVINO version (2025.2.0 , 2024.6.0, 2023.3.0)
ARG OPENVINO_VERSION=2025.2.0

# Extract the major version from the full version string
ENV OPENVINO_MAJOR_VERSION=${OPENVINO_VERSION%%.*}
Expand All @@ -26,7 +26,11 @@ ENV OPENVINO_MAJOR_VERSION=${OPENVINO_VERSION%%.*}
RUN apt update && \
apt install -y --no-install-recommends wget curl gnupg2 lsb-release software-properties-common apt-transport-https nano && \
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/${OPENVINO_MAJOR_VERSION} ubuntu22 main" | tee /etc/apt/sources.list.d/intel-openvino-${OPENVINO_MAJOR_VERSION}.list && \
if [ "$OPENVINO_MAJOR_VERSION" = "2025" ]; then \
echo "deb https://apt.repos.intel.com/openvino ubuntu22 main" > /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/*
Expand Down
8 changes: 4 additions & 4 deletions docker/ros2_ov202x/ros2_humble/docker_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 .
Expand Down
1 change: 1 addition & 0 deletions openvino_param_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded library path '/usr/lib/x86_64-linux-gnu/libyaml-cpp.so' is not portable across different architectures and distributions. Use find_package(yaml-cpp) or pkg_config to locate the library properly.

Copilot uses AI. Check for mistakes.

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion sample/param/pipeline_image.yaml
Original file line number Diff line number Diff line change
@@ -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
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded path '/home/skl/catkin_ws/' contains a specific username 'skl' which makes it non-portable across different environments. Consider using a relative path or environment variable.

Suggested change
input_path: /home/skl/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg
input_path: ${HOME}/catkin_ws/src/ros2_openvino_toolkit/data/images/sample_faces.jpg

Copilot uses AI. Check for mistakes.
infers:
- name: FaceDetection
model: /opt/openvino_toolkit/models/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml
Expand Down