Hello
When I try to add to my Dockerfile this line:
RUN git clone --recursive GitHub - stereolabs/zed-ros2-examples: A collection of examples and tutorials to illustrate how to better use the ZED cameras in the ROS2 framework
during build i see error:
181.2 Finished <<< zed_depth_to_laserscan [5.87s]
183.7 [100%] Linking CXX shared library libzed_aruco_localization_component.so
184.1 [100%] Built target zed_aruco_localization_component
184.2 -- Install configuration: "Release"
184.2 -- Installing: /root/ros2_ws/install/zed_aruco_localization/lib/libzed_aruco_localization_component.so
184.2 -- Set runtime path of "/root/ros2_ws/install/zed_aruco_localization/lib/libzed_aruco_localization_component.so" to ""
184.2 -- Installing: /root/ros2_ws/install/zed_aruco_localization/include/zed_aruco_localization/
184.2 -- Installing: /root/ros2_ws/install/zed_aruco_localization/include/zed_aruco_localization//aruco_loc_visibility_control.hpp
184.2 CMake Error at cmake_install.cmake:69 (file):
184.2 file INSTALL cannot find
184.2 "/root/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization/DIRECTORY":
184.2 No such file or directory.
184.2
184.2
184.2 [100%] Linking CXX executable zed_rgb_convert
184.3 --- stderr: zed_aruco_localization
184.3 CMake Error at cmake_install.cmake:69 (file):
184.3 file INSTALL cannot find
184.3 "/root/ros2_ws/src/zed-ros2-examples/examples/zed_aruco_localization/DIRECTORY":
184.3 No such file or directory.
184.3
184.3
184.3 ---
184.3 Failed <<< zed_aruco_localization [27.6s, exited with code 1]
184.8 [100%] Built target zed_rgb_convert
184.8 Aborted <<< zed_rgb_convert [28.1s]
184.9
184.9 Summary: 15 packages finished [3min 4s]
184.9 1 package failed: zed_aruco_localization
184.9 1 package aborted: zed_rgb_convert
184.9 3 packages had stderr output: zed_aruco_localization zed_interfaces zed_topic_benchmark_interfaces
------
2 warnings found (use --debug to expand):
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 20)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 54)
Dockerfile.zed_sdk:114
--------------------
113 | # Build the dependencies and the ZED ROS2 Wrapper
114 | >>> RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && \
115 | >>> colcon build --parallel-workers $(nproc) \
116 | >>> --event-handlers console_direct+ --base-paths src \
117 | >>> --cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
118 | >>> ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
119 | >>> ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \
120 | >>> ' --no-warn-unused-cli' "
121 |
--------------------
ERROR: failed to solve: process "/bin/bash -c /bin/bash -c \"source /opt/ros/$ROS_DISTRO/setup.bash && colcon build --parallel-workers $(nproc) --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' \"" did not complete successfully: exit code: 1
This is my Dockerfile:
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG ZED_SDK_MAJOR=4
ARG ZED_SDK_MINOR=1
ARG ZED_SDK_PATCH=0
ARG JETPACK_MAJOR=6
ARG JETPACK_MINOR=0
ARG L4T_MAJOR=36
ARG L4T_MINOR=3
ARG ROS2_DIST=humble # ROS2 distribution
# ZED ROS2 Wrapper dependencies version
ARG XACRO_VERSION=2.0.8
ARG DIAGNOSTICS_VERSION=3.0.0
ARG AMENT_LINT_VERSION=0.12.4
ARG GEOGRAPHIC_INFO_VERSION=1.0.4
ARG ROBOT_LOCALIZATION_VERSION=3.4.2
ENV DEBIAN_FRONTEND noninteractive
# Disable apt-get warnings
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA || true && \
apt-get update || true && apt-get install -y --no-install-recommends apt-utils dialog && \
rm -rf /var/lib/apt/lists/*
ENV TZ=Europe/Poland
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get update && \
apt-get install --yes lsb-release wget less udev sudo build-essential cmake python3 python3-dev python3-pip python3-wheel git jq libpq-dev zstd usbutils \
libgstreamer1.0-0 gstreamer1.0-libav libgstrtspserver-1.0-0 gstreamer1.0-tools \
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio \
libgstreamer1.0-dev libgstrtspserver-1.0-dev libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-0 \
libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-bad1.0-dev gstreamer1.0-rtsp gstreamer1.0-plugins-ugly && \
rm -rf /var/lib/apt/lists/*
# Install the ZED SDK, skip_tools; skip_drivers
RUN echo "# R${L4T_MAJOR} (release), REVISION: ${L4T_MINOR}" > /etc/nv_tegra_release && \
apt-get update -y || true && \
apt-get install -y --no-install-recommends zstd wget less cmake curl gnupg2 \
build-essential python3 python3-pip python3-dev python3-setuptools libusb-1.0-0-dev -y && \
pip install protobuf && \
wget -q --no-check-certificate -O ZED_SDK_Linux_JP.run \
https://download.stereolabs.com/zedsdk/${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}/l4t${L4T_MAJOR}.${L4T_MINOR}/jetsons && \
chmod +x ZED_SDK_Linux_JP.run ; ./ZED_SDK_Linux_JP.run silent skip_drivers && \
rm -rf /usr/local/zed/resources/* && \
rm -rf ZED_SDK_Linux_JP.run && \
rm -rf /var/lib/apt/lists/*
# Install the ZED ROS2 Wrapper
ENV ROS_DISTRO ${ROS2_DIST}
# Install the ZED ROS2 Wrapper
WORKDIR /root/ros2_ws/src
RUN git clone --recursive https://github.com/stereolabs/zed-ros2-wrapper.git
RUN git clone --recursive https://github.com/stereolabs/zed-ros2-examples.git
# 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
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y \
ros-humble-depthimage-to-laserscan \
ros-humble-ament-package \
ros-humble-ament-cmake-core \
ros-humble-ament-lint \
ros-humble-depthimage-to-laserscan \
ros-humble-angles \
ros-humble-ament-cmake-clang-format \
ros-humble-nmea-msgs \
ros-humble-geographic-msgs \
ros-humble-robot-localization \
ros-humble-grid-map
# ROS Python fundamentals
RUN python3 -m pip install -U \
pyads
# Install zed-gstreamer
WORKDIR /code
RUN git clone https://github.com/stereolabs/zed-gstreamer.git \
&& cd zed-gstreamer \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined" -DCUDA_CUDART_LIBRARY="/usr/local/cuda/lib64/libcudart.so" .. \
&& make \
&& sudo make install
# Check that all the dependencies are satisfied
WORKDIR /root/ros2_ws
RUN apt-get update -y || true && rosdep update && \
rosdep install --from-paths src --ignore-src -r -y && \
rm -rf /var/lib/apt/lists/*
# Install cython
RUN python3 -m pip install --upgrade cython
# Build the dependencies and the ZED ROS2 Wrapper
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && \
colcon build --parallel-workers $(nproc) \
--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' "
#WORKDIR /root/ros2_ws
# Setup environment variables
#COPY ros_entrypoint_jetson.sh /sbin/ros_entrypoint.sh
#RUN sudo chmod 755 /sbin/ros_entrypoint.sh
#ENTRYPOINT ["/sbin/ros_entrypoint.sh"]
#CMD ["bash"]
#This symbolic link is needed to use the streaming features on Jetson inside a container
RUN ln -sf /usr/lib/aarch64-linux-gnu/tegra/libv4l2.so.0 /usr/lib/aarch64-linux-gnu/libv4l2.so
RUN chmod -R 777 /usr/local/zed/
RUN chmod -R 777 /usr/local/lib/
RUN chmod -R 777 /root/
RUN chmod -R 777 /opt/ros/humble/