# ZED ROS 2 Wrapper Docker build fails

**URL:** <https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756>\
**Category:** Docker\
**Tags:** jetson\
**Created:** [August 7, 2024, 9:18am UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756 "2024-08-07T09:18:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 7, 2024, 9:18am UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/1 "2024-08-07T09:18:43Z")

</div>

Hello, I’m not able to build the Docker container for the ZED ROS 2 Wrapper on a Jetson device with JP 5.1.2 (L4T 35.4.1). I cloned the repository and ran “./jetson\_build\_dockerfile\_from\_sdk\_and\_l4T\_version.sh l4t-r35.4.1 zedsdk4.1.2” but I’m not able to build all ROS 2 packages. In particular “zed\_components” fails due to missing dependencies (see  
[error\_log.txt](https://community.stereolabs.com/uploads/short-url/d3rjSvu2PxYSrk5bInJNEABcLZT.txt) (7.7 KB)).

---

<div class="post-metadata">

**Author:** ![TanguyHardelin](https://community.stereolabs.com/user_avatar/community.stereolabs.com/tanguyhardelin/32/1298_2.png) [@TanguyHardelin](https://community.stereolabs.com/u/TanguyHardelin)\
**Post date:** [August 7, 2024, 12:15pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/2 "2024-08-07T12:15:04Z")

</div>

Hello @nweg ,

Did you install the SDK downloaded at [this link](https://www.stereolabs.com/en-fr/developers) ?

Regards,  
Tanguy

---

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 7, 2024, 12:23pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/3 "2024-08-07T12:23:16Z")

</div>

Hello @TanguyHardelin,

no. I’m not installing the ROS 2 Wrapper on the host itself but inside a Docker container. I’m using the Dockerfile ([zed-ros2-wrapper/docker/Dockerfile.l4t-humble at master · stereolabs/zed-ros2-wrapper (github.com)](https://github.com/stereolabs/zed-ros2-wrapper/blob/master/docker/Dockerfile.l4t-humble)) from the zed-ros2-wrapper repo.

This is probably supposed to work out-of-the-box?

Thanks for your help and regards,  
Nino

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [August 7, 2024, 4:47pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/4 "2024-08-07T16:47:02Z")

</div>

Hi @nweg,

Thank you for sharing information about your issue, I might see where the issue is coming from - we have added point cloud transport as a dependency to the wrapper recently, and have not added it into the dockerfile’s dependencies installs.

I will add this issue internally as a bug, in the meantime, you can add the installation of the point\_cloud\_transport package in the ros2 workspace in the Dockerfile.

---

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 8, 2024, 9:46am UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/5 "2024-08-08T09:46:53Z")

</div>

Hey @mattrouss,

thanks for your help. I actually had to add both point\_cloud\_transport and rcpputils to resolve all dependencies.

```auto
# Install missing dependencies
WORKDIR /root/ros2_ws/src
RUN wget https://github.com/ros/xacro/archive/refs/tags/${XACRO_VERSION}.tar.gz -O - | tar -xvz && mv xacro-${XACRO_VERSION} xacro && \
  wget https://github.com/ros/diagnostics/archive/refs/tags/${DIAGNOSTICS_VERSION}.tar.gz -O - | tar -xvz && mv diagnostics-${DIAGNOSTICS_VERSION} diagnostics && \
  wget https://github.com/ament/ament_lint/archive/refs/tags/${AMENT_LINT_VERSION}.tar.gz -O - | tar -xvz && mv ament_lint-${AMENT_LINT_VERSION} ament-lint && \
  wget https://github.com/cra-ros-pkg/robot_localization/archive/refs/tags/${ROBOT_LOCALIZATION_VERSION}.tar.gz -O - | tar -xvz && mv robot_localization-${ROBOT_LOCALIZATION_VERSION} robot-localization && \
  wget https://github.com/ros-geographic-info/geographic_info/archive/refs/tags/${GEOGRAPHIC_INFO_VERSION}.tar.gz -O - | tar -xvz && mv geographic_info-${GEOGRAPHIC_INFO_VERSION} geographic-info && \
  cp -r geographic-info/geographic_msgs/ . && \
  rm -rf geographic-info && \
  git clone https://github.com/ros-drivers/nmea_msgs.git --branch ros2 && \  
  git clone https://github.com/ros/angles.git --branch humble-devel && \
  git clone https://github.com/ros2/rcpputils.git --branch humble && \
  git clone https://github.com/ros-perception/point_cloud_transport.git --branch humble

```

I then also had to first build `rcpputils` and `point_cloud_transport`, source the local workspace and then build the rest of the packages. Otherwise it wouldn’t find the `point_cloud_transport` package

```auto
# Build the rcpputils and point_cloud_transport dependencies
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/install/setup.bash && \
  colcon build --parallel-workers $(nproc) --symlink-install --packages-select rcpputils point_cloud_transport \
  --event-handlers console_direct+ --base-paths src \
  --cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
  ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
  ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \
  ' --no-warn-unused-cli' "

# Build the dependencies and the ZED ROS2 Wrapper
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/install/setup.bash && source install/local_setup.bash && \
  colcon build --parallel-workers $(nproc) --symlink-install \
  --event-handlers console_direct+ --base-paths src \
  --cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
  ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
  ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \
  ' --no-warn-unused-cli' "

```

---

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 8, 2024, 11:51am UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/6 "2024-08-08T11:51:05Z")

</div>

Now I already ran into the next issue. After building the container I’m now starting the cameras using the following compose file

```auto
services:
  zed_camera:
    image: zed_ros2_wrapper
    runtime: nvidia
    stdin_open: true
    tty: true
    privileged: true
    network_mode: "host"
    ipc: host
    pid: host
    volumes:
      - /dev:/dev
      - /tmp/.X11-unix/:/tmp/.X11-unix
      - ./fast_dds.xml:/fast_dds.xml 
    environment:
      - NVIDIA_DRIVER_CAPABILITIES=all
      - DISPLAY
      - RMW_IMPLEMENTATION=rmw_fastrtps_cpp
      - FASTRTPS_DEFAULT_PROFILE_FILE=/fast_dds.xml
    command: bash -c "ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zed2i"

```

All topics are advertised but I can not get any data from outside the container for the image topics (imu data works). I also tried to use a custom fast\_dds.xml file to disable shm  
[fast\_dds.xml](https://community.stereolabs.com/uploads/short-url/uD5dWT1Sw4MTr9U0KqvKVYdspf0.xml) (716 Bytes) which didn’t help either.

Inside the container I can subscribe to all topics e.g. using ros2 topic hz.

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [August 8, 2024, 12:57pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/7 "2024-08-08T12:57:07Z")

</div>

This looks like a middleware issue. Can you remove the references to FastRTPS in the docker-compose file, as this is done in the entrypoint already.

Are you using FastRTPS as well on the host computer?

---

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 8, 2024, 1:10pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/8 "2024-08-08T13:10:13Z")

</div>

Same issue without any references to FastRTPS

```auto
services:
  zed_camera:
    image: zed_ros2_wrapper
    runtime: nvidia
    stdin_open: true
    tty: true
    privileged: true
    network_mode: "host"
    ipc: host
    pid: host
    volumes:
      - /dev:/dev
      - /tmp/.X11-unix/:/tmp/.X11-unix
    environment:
      - NVIDIA_DRIVER_CAPABILITIES=all
      - DISPLAY
      - ROS_DOMAIN_ID=0
      - ROS_LOCALHOST_ONLY=0
    command: bash -c "ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zed2i"

```

On the host:

```auto
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 topic hz /zed/zed_node/left_gray/image_rect_gray

```

is not working. While

```auto
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 topic hz /zed/zed_node/left_gray/camera_info

```

```auto
ros2 topic list

```

works.

Definitely seems like a RMW issue and normally I can make it work using the custom fast\_dds.xml but this doesn’t seem to change anything.

---

<div class="post-metadata">

**Author:** ![nweg](https://community.stereolabs.com/user_avatar/community.stereolabs.com/nweg/32/949_2.png) [@nweg](https://community.stereolabs.com/u/nweg)\
**Post date:** [August 8, 2024, 1:29pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/9 "2024-08-08T13:29:44Z")

</div>

The issue might actually be my host or network. I just tested and I’m able to receive images inside another container running on the same device.

Thank you anyways.

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [August 8, 2024, 2:00pm UTC](https://community.stereolabs.com/t/zed-ros-2-wrapper-docker-build-fails/6756/10 "2024-08-08T14:00:39Z")

</div>

What is surprising is the fact that this only affects images. Please let us know if you ever find a fix for the issue!
