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 (7.7 KB)).
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)) from the zed-ros2-wrapper repo.
This is probably supposed to work out-of-the-box?
Thanks for your help and regards,
Nino
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.
Hey @mattrouss,
thanks for your help. I actually had to add both point_cloud_transport and rcpputils to resolve all dependencies.
# 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
# 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' "
Now I already ran into the next issue. After building the container I’m now starting the cameras using the following compose file
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 (716 Bytes) which didn’t help either.
Inside the container I can subscribe to all topics e.g. using ros2 topic hz.
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?
Same issue without any references to FastRTPS
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:
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 topic hz /zed/zed_node/left_gray/image_rect_gray
is not working. While
RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 topic hz /zed/zed_node/left_gray/camera_info
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.
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.
What is surprising is the fact that this only affects images. Please let us know if you ever find a fix for the issue!