Closed MrOCW closed 1 year ago
Hi @MrOCW the master branch of the repository requires the latest ZED SDK v3.8.x to compile correctly.
This line is not required for ROS2 Humble:
git clone -b 3.0.0 https://github.com/ros-perception/image_common.git &&\
you must instead use this line to clone the ZED ROS2 Wrapper (the line is missing):
git clone --recursive https://github.com/stereolabs/zed-ros2-wrapper.git && \
I tried to build the image using the fixed Dockerfile and the problem that you reported is not present, maybe you have not correctly downloaded the SDK v3.8. Try to clean and rebuild the image.
There is instead a bigger problem: the base image that you are using dustynv/ros:humble-ros-base-l4t-r35.1.0
seems derived by the l4t-r35.1.0
image that does not contain CUDA, so it is not possible to use the ZED SDK with it:
--- stderr: zed_wrapper
* Found ROS2 humble
* ROS2 humble is officially supported by this package.
/usr/bin/ld: warning: libcuda.so.1, needed by /usr/local/zed/lib/libsl_zed.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvbuf_utils.so.1.0.0, needed by /usr/local/zed/lib/libsl_zed.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxPushCurrent_v2'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferMemMap'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuStreamSynchronize'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferMemUnMap'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxPopCurrent_v2'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferMemSyncForDevice'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxSetCurrent'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxCreate_v2'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferGetParams'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferDestroy'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferCreateEx'
/usr/bin/ld: /opt/ros/humble/install/lib/libzed_camera_component.so: undefined reference to `cuCtxGetDevice'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuGetErrorName'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferTransform'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuMemcpy2DAsync_v2'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxDestroy_v2'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `NvBufferMemSyncForCpu'
/usr/bin/ld: /usr/local/zed/lib/libsl_zed.so: undefined reference to `cuCtxGetCurrent'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/zed_wrapper.dir/build.make:363: zed_wrapper] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/zed_wrapper.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed <<< zed_wrapper [1min 20s, exited with code 2]
@Myzhar Nvidida Jetson docker images contain stubs of the cuda library. You can compile the ZED SDK in it with the following colcon command:
colcon build --symlink-install --event-handlers console_direct+ --base-paths src/zed-ros2-wrapper --cmake-args ' -DCMAKE_BUILD_TYPE=Release' ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"'
Link to the repository with the Dockerfile which I am using to build it: https://github.com/rosblox/ros-zed-ros2-wrapper It builds and runs successfully for L4T 35.1 with ROS2 Humble on my Jetson Xavier NX.
Changes compared to above:
Resulting Dockerfile:
FROM --platform=arm64 alpine:latest as unzipper
RUN apk add unzip wget curl
WORKDIR /opt
ARG XACRO_VERSION=2.0.8
RUN wget https://github.com/ros/xacro/archive/refs/tags/${XACRO_VERSION}.tar.gz -O - | tar -xvz && mv xacro-${XACRO_VERSION} xacro
ARG DIAGNOSTICS_VERSION=3.0.0
RUN wget https://github.com/ros/diagnostics/archive/refs/tags/${DIAGNOSTICS_VERSION}.tar.gz -O - | tar -xvz && mv diagnostics-${DIAGNOSTICS_VERSION} diagnostics
FROM --platform=arm64 dustynv/ros:humble-ros-base-l4t-r35.1.0
ARG ZED_SDK_URL="https://download.stereolabs.com/zedsdk/3.8/l4t35.1/jetsons"
ARG ZED_SDK_RUN="ZED_SDK_Linux_JP.run"
RUN cd /tmp && \
apt update && apt install zstd -y --no-install-recommends && \
wget --quiet --show-progress --progress=bar:force:noscroll --no-check-certificate ${ZED_SDK_URL} -O ${ZED_SDK_RUN} && \
chmod +x ${ZED_SDK_RUN} && \
./${ZED_SDK_RUN} silent skip_tools && \
rm -rf /usr/local/zed/resources/* && \
rm -rf ${ZED_SDK_RUN} && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
WORKDIR /colcon_ws
COPY --from=unzipper /opt/xacro src/xacro
COPY --from=unzipper /opt/diagnostics src/diagnostics
RUN git clone --recursive https://github.com/stereolabs/zed-ros2-wrapper src/zed-ros2-wrapper && \
. /opt/ros/${ROS_DISTRO}/install/setup.sh && \
colcon build --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"'
WORKDIR /
COPY ros_entrypoint.sh .
Thank you for sharing :+1:
You are welcome.
You can pull the image: docker pull ghcr.io/rosblox/ros-zed-ros2-wrapper:humble
Do you plan to add nav2 support?
Nope, this image will remain standalone, i.e. pure zed-ros2-wrapper. I'd recommend implementing nav2 support in another container.
Yes, I agree with this. I pinned this issue as a future reference for everyone.
@maxpolzin
You can pull the image: docker pull ghcr.io/rosblox/ros-zed-ros2-wrapper:humble
is the image publicly available? We can't pull it:
Head "https://ghcr.io/v2/rosblox/ros-zed-ros2-wrapper/manifests/humble": unauthorized
My bad... It should be publicly available now. Let me know if it works.
Note, the image is built based on my fork of the zed-ros2-wrapper.
Thank you :)
Preliminary Checks
Description
Build fails in a humble container for Jetpack 5.0.2
Steps to Reproduce
Expected Result
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release suceeds
Actual Result
ZED Camera model
ZED2i
Environment
Anything else?
No response