stereolabs / zed-ros2-wrapper

ROS 2 wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros2/
Apache License 2.0
140 stars 143 forks source link

Zed 2i Multi-Camera Detection Issue #166

Closed alberthli closed 11 months ago

alberthli commented 11 months ago

Preliminary Checks

Description

We're experiencing a bug where when using multiple ZED 2i cameras, the detection of the cameras is inconsistent. We are using a containerized setup via Docker. The relevant files to reproduce are attached here.

When running the multi-camera launch file provided in the Zed ROS2 examples repository with the command

ros2 launch zed_multi_camera zed_multi_camera.launch.py cam_names:="[cam1, cam2]" cam_models:="[zed2i, zed2i]" cam_serials:="[32144978,33143189]" cam_poses:="[[0.0,0.0,0.0,0.0,0.0,0.0], [0.0,0.0,0.0,0.0,0.0,0.0]]"

we see the following error:

[zed_wrapper-4] [ZED][WARNING] CAMERA NOT DETECTED in sl::ERROR_CODE sl::Camera::open(sl::InitParameters)
[zed_wrapper-4] [WARN] [1689024671.018911764] [camera_33143189.zed_node]: Error opening camera: CAMERA NOT DETECTED
[zed_wrapper-4] [INFO] [1689024671.018976626] [camera_33143189.zed_node]: Please verify the camera connection

Additional details regarding the error:

Additional things we have tested:

Steps to Reproduce

Because it is unclear what exactly causes the failure, we cannot reproduce the bug with 100% accuracy. However, doing something in the following list usually causes it.

  1. Build the provided docker image using the command

    docker image build -t test .
  2. Start a container using the provided bash script with the command

    bash startup.sh -n test

    in the directory where the provided files are unzipped.

  3. In the container, run the command (possibly multiple times until failure)

    ros2 launch zed_multi_camera zed_multi_camera.launch.py cam_names:="[cam1, cam2]" cam_models:="[zed2i, zed2i]" cam_serials:="[32144978,33143189]" cam_poses:="[[0.0,0.0,0.0,0.0,0.0,0.0], [0.0,0.0,0.0,0.0,0.0,0.0]]"
  4. If step 3 does not cause failure, try joining the existing container by opening a new one using the command

    bash startup.sh -n test -j

    Run the command from step 3 repeatedly.

  5. If step 4 does not cause failure, try exiting the container from step 4 and rejoining. Again, run the command from step 3 until failure.

  6. If step 5 does not cause failure, unplug and replug the cameras in the same or different port and repeat step 5.

Expected Result

We would expect that the two cameras should launch and be detected without issue.

Actual Result

However, only one is detected most of the time, and usually the issue comes up when we need to start/stop our Zed-related nodes.

ZED Camera model

ZED2i

Environment

OS: Ubuntu 22.04 on local machine, Ubuntu 20.04 in Docker container
CPU: AMD Ryzen Threadripper PRO 5995WX 64-Cores
GPUs: Nvidia RTX4090 (x2)
ZED SDK version: 4.0
ROS version: Foxy (also tested on Humble)

Output of nvcc --version:

Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0
Myzhar commented 11 months ago

Hi @alberthli what is the SDK version that you are using?

alberthli commented 11 months ago

We're using version 4.0. Specifically, we're using the Stereolabs base image stereolabs/zed:4.0-devel-cuda12.1-ubuntu20.04 from Dockerhub (file provided near the top of the issue).

Myzhar commented 11 months ago

This is a problem not related to the ZED ROS2 Wrapper, but to the ZED SDK. The ZED SDK team is already on it and a fix will be released as soon as possible with one of the next patch versions. Thank you for reporting and for the useful information. If you have other useful information please send an email to support@stereolabs.com. I close this issue.

alberthli commented 11 months ago

Thank you for the speedy reply. I'll keep an eye out for the next release. If the team needs more specific information, feel free to tag me on this issue as well, and I would be happy to provide it.

lzyang2000 commented 11 months ago

We are also running into the exact same problem - may I ask is there any update on the timeline of the patch? Thank you!