stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 392 forks source link

ZED connection -> CAMERA FAILED TO SETUP on cuda 11.5 ,ubuntu 20.04 #800

Closed RamanaBotta closed 2 years ago

RamanaBotta commented 2 years ago

Preliminary Checks

Description

after installing cuda 11.5 zed_wrapper stopped working. previously it used to work fine. we are testing on two machines but results are the same . when i run ZED_Diagnose -> results are "make sure the camera pulgged in or try another usb port". i don't understand is this a problem of cuda or zed sdk. please help Thank you Raman

Steps to Reproduce

roslaunch zed_wrapper zed2.launch

Expected Result

Success

Actual Result

[ INFO] [1639042935.835651212]: ZED connection -> CAMERA FAILED TO SETUP

ZED Camera model

ZED2

Environment

OS: POP OS 20.04
ZED_SKD: 3.6
ROS: Neotic
GPU:Nvidia

Anything else?

 roslaunch zed_wrapper zed2.launch 
... logging to /home/boson/.ros/log/394a9ac6-58d4-11ec-87af-bf3592a9fe5b/roslaunch-pop-os-15365.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
WARNING: disk usage in log directory [/home/boson/.ros/log] is over 1GB.
It's recommended that you use the 'rosclean' command.

started roslaunch server http://pop-os:40473/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.13
 * /zed2/zed2_description: <?xml version="1....
 * /zed2/zed_node/auto_exposure_gain: True
 * /zed2/zed_node/auto_whitebalance: True
 * /zed2/zed_node/brightness: 4
 * /zed2/zed_node/contrast: 4
 * /zed2/zed_node/depth/depth_downsample_factor: 1.0
 * /zed2/zed_node/depth/depth_stabilization: 1
 * /zed2/zed_node/depth/max_depth: 20.0
 * /zed2/zed_node/depth/min_depth: 0.3
 * /zed2/zed_node/depth/openni_depth_mode: False
 * /zed2/zed_node/depth/quality: 1
 * /zed2/zed_node/depth/sensing_mode: 0
 * /zed2/zed_node/depth_confidence: 50
 * /zed2/zed_node/depth_texture_conf: 100
 * /zed2/zed_node/exposure: 100
 * /zed2/zed_node/gain: 100
 * /zed2/zed_node/gamma: 8
 * /zed2/zed_node/general/base_frame: base_link
 * /zed2/zed_node/general/camera_flip: False
 * /zed2/zed_node/general/camera_model: zed2
 * /zed2/zed_node/general/camera_name: zed2
 * /zed2/zed_node/general/gpu_id: -1
 * /zed2/zed_node/general/grab_frame_rate: 100
 * /zed2/zed_node/general/resolution: 3
 * /zed2/zed_node/general/self_calib: True
 * /zed2/zed_node/general/serial_number: 0
 * /zed2/zed_node/general/svo_compression: 2
 * /zed2/zed_node/general/verbose: False
 * /zed2/zed_node/general/zed_id: 0
 * /zed2/zed_node/hue: 0
 * /zed2/zed_node/mapping/fused_pointcloud_freq: 1.0
 * /zed2/zed_node/mapping/mapping_enabled: False
 * /zed2/zed_node/mapping/max_mapping_range: -1
 * /zed2/zed_node/mapping/resolution: 0.05
 * /zed2/zed_node/object_detection/body_fitting: False
 * /zed2/zed_node/object_detection/confidence_threshold: 50
 * /zed2/zed_node/object_detection/max_range: 15.0
 * /zed2/zed_node/object_detection/mc_animal: True
 * /zed2/zed_node/object_detection/mc_bag: True
 * /zed2/zed_node/object_detection/mc_electronics: True
 * /zed2/zed_node/object_detection/mc_fruit_vegetable: True
 * /zed2/zed_node/object_detection/mc_people: True
 * /zed2/zed_node/object_detection/mc_vehicle: True
 * /zed2/zed_node/object_detection/model: 3
 * /zed2/zed_node/object_detection/object_tracking_enabled: True
 * /zed2/zed_node/object_detection/od_enabled: False
 * /zed2/zed_node/point_cloud_freq: 100.0
 * /zed2/zed_node/pos_tracking/area_memory: True
 * /zed2/zed_node/pos_tracking/area_memory_db_path: zed_area_memory.area
 * /zed2/zed_node/pos_tracking/fixed_z_value: 0.0
 * /zed2/zed_node/pos_tracking/floor_alignment: False
 * /zed2/zed_node/pos_tracking/imu_fusion: True
 * /zed2/zed_node/pos_tracking/init_odom_with_first_valid_pose: True
 * /zed2/zed_node/pos_tracking/initial_base_pose: [0.0, 0.0, 0.0, 0...
 * /zed2/zed_node/pos_tracking/map_frame: map
 * /zed2/zed_node/pos_tracking/odometry_frame: odom
 * /zed2/zed_node/pos_tracking/path_max_count: -1
 * /zed2/zed_node/pos_tracking/path_pub_rate: 2.0
 * /zed2/zed_node/pos_tracking/pos_tracking_enabled: True
 * /zed2/zed_node/pos_tracking/publish_map_tf: True
 * /zed2/zed_node/pos_tracking/publish_tf: True
 * /zed2/zed_node/pos_tracking/save_area_memory_db_on_exit: False
 * /zed2/zed_node/pos_tracking/two_d_mode: False
 * /zed2/zed_node/pub_frame_rate: 100.0
 * /zed2/zed_node/saturation: 4
 * /zed2/zed_node/sensors/publish_imu_tf: True
 * /zed2/zed_node/sensors/sensors_timestamp_sync: False
 * /zed2/zed_node/sharpness: 4
 * /zed2/zed_node/stream: 
 * /zed2/zed_node/svo_file: 
 * /zed2/zed_node/video/extrinsic_in_camera_frame: True
 * /zed2/zed_node/video/img_downsample_factor: 1.0
 * /zed2/zed_node/whitebalance_temperature: 42

NODES
  /zed2/
    zed2_state_publisher (robot_state_publisher/robot_state_publisher)
    zed_node (zed_wrapper/zed_wrapper_node)

auto-starting new master
process[master]: started with pid [15435]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 394a9ac6-58d4-11ec-87af-bf3592a9fe5b
process[rosout-1]: started with pid [15476]
started core service [/rosout]
process[zed2/zed2_state_publisher-2]: started with pid [15483]
process[zed2/zed_node-3]: started with pid [15484]
[ INFO] [1639042906.763505607]: Initializing nodelet with 16 worker threads.
[ INFO] [1639042906.770943616]: ********** Starting nodelet '/zed2/zed_node' **********
[ INFO] [1639042906.770965842]: SDK version : 3.6.2
[ INFO] [1639042906.770978786]: *** GENERAL PARAMETERS ***
[ INFO] [1639042906.771095641]:  * Camera Name          -> zed2
[ INFO] [1639042906.771205833]:  * Camera Resolution        -> VGA
[ INFO] [1639042906.771309714]:  * Camera Grab Framerate    -> 100
[ INFO] [1639042906.771412998]:  * Gpu ID           -> -1
[ INFO] [1639042906.771515176]:  * Camera ID            -> -1
[ INFO] [1639042906.771617249]:  * Verbose          -> DISABLED
[ INFO] [1639042906.771814494]:  * Camera Flip          -> DISABLED
[ INFO] [1639042906.772010192]:  * Self calibration     -> ENABLED
[ INFO] [1639042906.772219716]:  * Camera Model by param    -> zed2
[ INFO] [1639042906.772226610]: *** VIDEO PARAMETERS ***
[ INFO] [1639042906.772341281]:  * Image resample factor    -> 1
[ INFO] [1639042906.772444990]:  * Extrinsic param. frame   -> X RIGHT - Y DOWN - Z FWD
[ INFO] [1639042906.772451425]: *** DEPTH PARAMETERS ***
[ INFO] [1639042906.772552878]:  * Depth quality        -> PERFORMANCE
[ INFO] [1639042906.772656122]:  * Depth Sensing mode       -> STANDARD
[ INFO] [1639042906.772758749]:  * OpenNI mode          -> DISABLED
[ INFO] [1639042906.772860058]:  * Depth Stabilization      -> ENABLED
[ INFO] [1639042906.772969151]:  * Minimum depth        -> 0.3 m
[ INFO] [1639042906.773110690]:  * Maximum depth        -> 20 m
[ INFO] [1639042906.773267279]:  * Depth resample factor    -> 1
[ INFO] [1639042906.773275295]: *** POSITIONAL TRACKING PARAMETERS ***
[ INFO] [1639042906.773585091]:  * Positional tracking      -> ENABLED
[ INFO] [1639042906.773749067]:  * Path rate            -> 2 Hz
[ INFO] [1639042906.773871160]:  * Path history size        -> 1
[ INFO] [1639042906.774138166]:  * Odometry DB path     -> /home/boson/.ros/zed_area_memory.area
[ INFO] [1639042906.774351060]:  * Save Area Memory on closing  -> DISABLED
[ INFO] [1639042906.774596990]:  * Area Memory          -> ENABLED
[ INFO] [1639042906.774796369]:  * IMU Fusion           -> ENABLED
[ INFO] [1639042906.774991084]:  * Floor alignment      -> DISABLED
[ INFO] [1639042906.775190736]:  * Init Odometry with first valid pose data -> ENABLED
[ INFO] [1639042906.775387923]:  * Two D mode           -> DISABLED
[ INFO] [1639042906.775585871]: *** MAPPING PARAMETERS ***
[ INFO] [1639042906.775785785]:  * Mapping          -> DISABLED
[ INFO] [1639042906.775794443]: *** OBJECT DETECTION PARAMETERS ***
[ INFO] [1639042906.775994171]:  * Object Detection     -> DISABLED
[ INFO] [1639042906.776001220]: *** SENSORS PARAMETERS ***
[ INFO] [1639042906.776104348]:  * Sensors timestamp sync   -> DISABLED
[ INFO] [1639042906.776115800]: *** SVO PARAMETERS ***
[ INFO] [1639042906.776323192]:  * SVO input file:      -> 
[ INFO] [1639042906.776426762]:  * SVO REC compression      -> H265 (HEVC)
[ INFO] [1639042906.776619420]: *** COORDINATE FRAMES ***
[ INFO] [1639042906.777181653]:  * map_frame            -> map
[ INFO] [1639042906.777190313]:  * odometry_frame       -> odom
[ INFO] [1639042906.777196199]:  * base_frame           -> base_link
[ INFO] [1639042906.777206007]:  * camera_frame         -> zed2_camera_center
[ INFO] [1639042906.777214080]:  * imu_link         -> zed2_imu_link
[ INFO] [1639042906.777222930]:  * left_camera_frame        -> zed2_left_camera_frame
[ INFO] [1639042906.777229398]:  * left_camera_optical_frame    -> zed2_left_camera_optical_frame
[ INFO] [1639042906.777235988]:  * right_camera_frame       -> zed2_right_camera_frame
[ INFO] [1639042906.777242891]:  * right_camera_optical_frame   -> zed2_right_camera_optical_frame
[ INFO] [1639042906.777249500]:  * depth_frame          -> zed2_left_camera_frame
[ INFO] [1639042906.777256277]:  * depth_optical_frame      -> zed2_left_camera_optical_frame
[ INFO] [1639042906.777263024]:  * disparity_frame      -> zed2_left_camera_frame
[ INFO] [1639042906.777269463]:  * disparity_optical_frame  -> zed2_left_camera_optical_frame
[ INFO] [1639042906.777275884]:  * confidence_frame     -> zed2_left_camera_frame
[ INFO] [1639042906.777282464]:  * confidence_optical_frame -> zed2_left_camera_optical_frame
[ INFO] [1639042906.777475500]:  * Broadcast odometry TF    -> ENABLED
[ INFO] [1639042906.777667463]:  * Broadcast map pose TF    -> ENABLED
[ INFO] [1639042906.777861335]:  * Broadcast IMU pose TF    -> ENABLED
[ INFO] [1639042906.777868122]: *** DYNAMIC PARAMETERS (Init. values) ***
[ INFO] [1639042906.777969521]:  * [DYN] Depth confidence   -> 50
[ INFO] [1639042906.778070548]:  * [DYN] Depth texture conf.    -> 100
[ INFO] [1639042906.778173152]:  * [DYN] pub_frame_rate     -> 100 Hz
[ INFO] [1639042906.778276872]:  * [DYN] point_cloud_freq   -> 100 Hz
[ INFO] [1639042906.778378626]:  * [DYN] brightness     -> 4
[ INFO] [1639042906.778479635]:  * [DYN] contrast       -> 4
[ INFO] [1639042906.778580115]:  * [DYN] hue            -> 0
[ INFO] [1639042906.778681742]:  * [DYN] saturation     -> 4
[ INFO] [1639042906.778781461]:  * [DYN] sharpness      -> 4
[ INFO] [1639042906.778881451]:  * [DYN] gamma          -> 8
[ INFO] [1639042906.778981557]:  * [DYN] auto_exposure_gain -> ENABLED
[ INFO] [1639042906.779265687]:  * [DYN] auto_whitebalance  -> ENABLED
[ INFO] [1639042906.780945915]:  * Camera coordinate system -> Right HANDED Z UP and X FORWARD
[ INFO] [1639042906.780974003]:  *** Opening ZED 2...
[ZED][Init][Info] Camera opening timeout reached
[ INFO] [1639042912.849360769]: ZED connection -> CAMERA FAILED TO SETUP
[ZED][Init][Info] Camera opening timeout reached
[ INFO] [1639042920.955599181]: ZED connection -> CAMERA FAILED TO SETUP
[ZED][Init][Info] Camera opening timeout reached
[ INFO] [1639042928.295849919]: ZED connection -> CAMERA FAILED TO SETUP
[ZED][Init][Info] Camera opening timeout reached
[ INFO] [1639042935.835651212]: ZED connection -> CAMERA FAILED TO SETUP
[ZED][Init][Info] Camera opening timeout reached
[ INFO] [1639042945.567493258]: ZED connection -> CAMERA FAILED TO SETUP
^[[1;2A^[[1;2A^[[1;2A^C[zed2/zed_node-3] killing on exit
[zed2/zed2_state_publisher-2] killing on exit
^C[ZED][Init][Info] Camera opening timeout reached
ZED Nodelet destroyed
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
Myzhar commented 2 years ago

Hi @RamanaBotta, did you reinstall the ZED SDK after upgrading to CUDA 11.5? You must use the ZED SDK v3.6.2 that has been released recently with CUDA 11.5. Regarding the ZED ROS Wrapper, after updating the ZED SDK, you must recompile it, but first you must clear the CMake cache by deleting the build and devel folders in the root of your catkin workspace

RamanaBotta commented 2 years ago

Thank you @Myzhar Yes i did these steps, i installed cuda 11.5 then installed ZED SDK 3.6.2 , then when i ran ZED_Diagnose tool following is the result

{
    "Camera Test": {
        "ZEDCount": 0,
        "error": [
            "<b>Camera not detected</b> <br/> Make sure the camera is plugged in or try another USB 3.0 port."
        ]
    },
    "Graphics Card": {
        "deviceCount": 1,
        "deviceDriverVersion": 11050,
        "devices": [
            {
                "arch": "Ampere",
                "computeCapability": "8.6",
                "cores": 3840,
                "name": "NVIDIA GeForce RTX 3060 Laptop GPU",
                "totalMemoryBytes": "6235422720",
                "totalMemoryMB": 5946.5625
            }
        ],
        "initResult": 0,
        "valid": [
            "<b>Graphics card: </b> NVIDIA GeForce RTX 3060 Laptop GPU"
        ]
    },
    "Processor": {
        "OS": "Pop!_OS 20.04 LTS ",
        "avxSupported": true,
        "coreCount": "16",
        "cpu": " 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz",
        "datetime": "2021-12-09 03:26:11 PM",
        "hyperThreading": "1",
        "motherboard": "QX60_TLS, TGL",
        "ramCapacity": "16.545808",
        "ramUsage": "",
        "ramUsed": "5.210305",
        "threadCount": "32",
        "valid": [
            "<b>Processor: </b>  11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz",
            "<b>Motherboard: </b> QX60_TLS, TGL"
        ]
    },
    "USB": {
        "CorruptedFirmware": false,
        "MCUDetected": true,
        "USBList": [
            {
                "USBMode": 3,
                "USB_path": "/2",
                "bDescriptorType": 1,
                "bDeviceProtocol": 1,
                "bLength": 18,
                "bMaxPacketSize0": 9,
                "bNumConfigurations": 1,
                "bcdDevice": "1.0",
                "bcdUSB": "3.0",
                "bcdUSBClass": 239,
                "bcdUSBSubClass": 2,
                "busNumber": 4,
                "device": "ZED2",
                "iManufacturer": 1,
                "iProduct": 2,
                "iSerial": 0,
                "idProduct": "0xf780",
                "idVendor": "0x2b03"
            },
            {
                "USB_path": "/9",
                "idProduct": "0xa061",
                "idVendor": "0x0408"
            },
            {
                "USBMode": 2,
                "USB_path": "/4/2",
                "bDescriptorType": 1,
                "bDeviceProtocol": 0,
                "bLength": 18,
                "bMaxPacketSize0": 64,
                "bNumConfigurations": 1,
                "bcdDevice": "3.8",
                "bcdUSB": "2.0",
                "bcdUSBClass": 0,
                "bcdUSBSubClass": 0,
                "busNumber": 3,
                "device": "ZED2 MCU",
                "iManufacturer": 1,
                "iProduct": 2,
                "iSerial": 3,
                "idProduct": "0xf781",
                "idVendor": "0x2b03"
            },
            {
                "USB_path": "/4",
                "idProduct": "0x2512",
                "idVendor": "0x0424"
            },
            {
                "USB_path": "/14",
                "idProduct": "0x0026",
                "idVendor": "0x8087"
            }
        ],
        "USBMode": 3,
        "ZED Camera Module Detected": 63360,
        "ZED MCU Module Detected": 63361,
        "ZEDDetected": true,
        "notTested": [
            "Please connect a camera to test the USB connection."
        ]
    },
    "ZED SDK": {
        "CUDA Toolkit version": "V11.5.119",
        "DiagnosticZEDSDKVersion": "3.6.2",
        "InstalledZEDSDKVersion": "Unknown",
        "SMI": "(SMI) :     Performance State                     : P8",
        "ai": {
            "checkAI": true,
            "cudaVersion": 11050,
            "cudnnCudartVersion": 11030,
            "cudnnVersion": 8201,
            "cudnnVersionExpected": 8201,
            "tensorVersion": 8201
        },
        "binFiles": [
            "libsl_ai.so",
            "libsl_zed.so",
            "libsl_zed_static.a"
        ],
        "cudaDeviceCount": 0,
        "cudaLoaded": true,
        "initResult": 1,
        "loaded": true,
        "resourcesFiles": [
        ],
        "resourcesFilesExpected": [
            "objects_performance_2.1"
        ],
        "valid": [
            "<b>CUDA version:</b> 11.5"
        ],
        "warning": [
            "Multiple version of CUDA has been detected. It is recommended to uninstall other versions than 11.5."
        ]
    }
}
Myzhar commented 2 years ago

The camera is correctly enumerated by the operating system and it is available in the USB resources, so I suppose that there is something odd with your GPU driver or CUDA installation.

Can you check in the /usr/local/ folder if there is more than a version of CUDA available? Please also copy and paste the outputs of the commands nvcc --version and nvidia-smi.

RamanaBotta commented 2 years ago

$ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

$ nvidia-smi

Thu Dec  9 19:58:42 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   36C    P5    N/A /  N/A |      0MiB /  5946MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

$ ls /usr/local/ bin cuda cuda-11 cuda-11.5 etc games include lib man sbin share src zed

Myzhar commented 2 years ago

Nothing odd there. Can you try to open the camera with a webcam application (e.g cheese or guvcview) to verify that the UVC module is correctly working?

RamanaBotta commented 2 years ago

No I can not open zed camera with webcam applications (e.g cheese or guvcview). what should i do now ?

Myzhar commented 2 years ago

@RamanaBotta your problem is probably not related with the CUDA upgrade, it's almost surely an HW problem. Discussing here is off-topic. I close the issue, please write an email to support@stereolabs.com to go further to find a solution.