Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running 2 d435i cameras on Ubuntu 22 with Docker #3234

Open
kushal2507 opened this issue Oct 25, 2024 · 3 comments
Open

Problems running 2 d435i cameras on Ubuntu 22 with Docker #3234

kushal2507 opened this issue Oct 25, 2024 · 3 comments
Labels

Comments

@kushal2507
Copy link

kushal2507 commented Oct 25, 2024


Required Info
Camera Model D435i
Firmware Version 5.16.0 .1
Operating System & Version Ubuntu 22
Kernel Version (Linux Only) 6.8.0-47-generic
Platform PC
Librealsense SDK Version 2.56.2
ROS Distro Humble
RealSense ROS Wrapper Version v4.55.1

Issue Description

I am truing to run 2 intel d435i cameras on my ros2 humble ubuntu 22 docker container. I followed the instructions mentioned here to clone and compile librealsense. Attached below is the log after I launch the two cameras :

ros2 launch bgl_hardware_launcher multi_realsense.launch.py 
[INFO] [launch]: All log files can be found below /home/bgldev/.ros/log/2024-10-25-12-43-27-226480-bglnlamrproto-481138
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [realsense2_camera_node-1]: process started with pid [481140]
[INFO] [realsense2_camera_node-2]: process started with pid [481142]
[realsense2_camera_node-1] [INFO] [1729853007.345913787] [camera_front]: RealSense ROS v4.55.1
[realsense2_camera_node-1] [INFO] [1729853007.345961512] [camera_front]: Built with LibRealSense v2.56.2
[realsense2_camera_node-1] [INFO] [1729853007.345968348] [camera_front]: Running with LibRealSense v2.56.2
[realsense2_camera_node-2] [INFO] [1729853007.346032214] [camera_rear]: RealSense ROS v4.55.1
[realsense2_camera_node-2] [INFO] [1729853007.346074619] [camera_rear]: Built with LibRealSense v2.56.2
[realsense2_camera_node-2] [INFO] [1729853007.346081609] [camera_rear]: Running with LibRealSense v2.56.2
[realsense2_camera_node-2]  25/10 12:43:27,354 WARNING [134281101837888] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:27,364 WARNING [134281101837888] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:27,374 ERROR [134281101837888] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-2]  25/10 12:43:27,374 ERROR [134281133295168] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-2]  25/10 12:43:27,374 ERROR [134281133295168] (rs.cpp:255) [rs2_create_device( info_list:0x7a20a4004cc0, index:0 ) UNKNOWN] failed to set power state
[realsense2_camera_node-2]  25/10 12:43:27,374 ERROR [134281133295168] (rs.cpp:255) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
[realsense2_camera_node-2]  25/10 12:43:27,374 WARNING [134281133295168] (rs.cpp:391) null pointer passed for argument "device"
[realsense2_camera_node-2] [WARN] [1729853007.374737117] [camera_rear]: Device 1/2 failed with exception: failed to set power state
[realsense2_camera_node-1] [INFO] [1729853007.466937984] [camera_front]: Device with serial number 031522070524 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1729853007.466991343] [camera_front]: Device with physical ID 2-2-33 was found.
[realsense2_camera_node-1] [INFO] [1729853007.466997061] [camera_front]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1729853007.467118276] [camera_front]: Device with port number 2-2 was found.
[realsense2_camera_node-2]  25/10 12:43:27,472 WARNING [134281112323648] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:27,485 WARNING [137682535581248] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:27,495 WARNING [137682535581248] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:27,505 ERROR [137682535581248] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-1]  25/10 12:43:27,505 ERROR [137683045189184] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-1]  25/10 12:43:27,506 ERROR [137683045189184] (rs.cpp:255) [rs2_create_device( info_list:0x7d38b0004cc0, index:1 ) UNKNOWN] failed to set power state
[realsense2_camera_node-1]  25/10 12:43:27,506 ERROR [137683045189184] (rs.cpp:255) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
[realsense2_camera_node-1]  25/10 12:43:27,506 WARNING [137683045189184] (rs.cpp:391) null pointer passed for argument "device"
[realsense2_camera_node-1] [WARN] [1729853007.506226044] [camera_front]: Device 2/2 failed with exception: failed to set power state
[realsense2_camera_node-1] [ERROR] [1729853007.506279817] [camera_front]: The requested device with serial number 025222070751 is NOT found. Will Try again.
[realsense2_camera_node-2] [INFO] [1729853007.511756842] [camera_rear]: Device with serial number 025222070751 was found.
[realsense2_camera_node-2] 
[realsense2_camera_node-2] [INFO] [1729853007.511808267] [camera_rear]: Device with physical ID 2-4-32 was found.
[realsense2_camera_node-2] [INFO] [1729853007.511824194] [camera_rear]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-2] [INFO] [1729853007.512005283] [camera_rear]: Device with port number 2-4 was found.
[realsense2_camera_node-2] [ERROR] [1729853007.512026405] [camera_rear]: The requested device with serial number 031522070524 is NOT found. Will Try again.
[realsense2_camera_node-2]  25/10 12:43:33,529 WARNING [134280741127744] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:33,543 WARNING [137682715936320] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:33,543 WARNING [134280741127744] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Device or resource busy, number: 16
[realsense2_camera_node-1]  25/10 12:43:33,553 WARNING [137682715936320] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:33,563 ERROR [137682715936320] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-1]  25/10 12:43:33,563 ERROR [137683045189184] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-1]  25/10 12:43:33,564 ERROR [137683045189184] (rs.cpp:255) [rs2_create_device( info_list:0x7d38b0022470, index:0 ) UNKNOWN] failed to set power state
[realsense2_camera_node-1]  25/10 12:43:33,564 ERROR [137683045189184] (rs.cpp:255) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
[realsense2_camera_node-1]  25/10 12:43:33,564 WARNING [137683045189184] (rs.cpp:391) null pointer passed for argument "device"
[realsense2_camera_node-1] [WARN] [1729853013.564381487] [camera_front]: Device 1/2 failed with exception: failed to set power state
[realsense2_camera_node-2] [INFO] [1729853013.612388814] [camera_rear]: Device with serial number 031522070524 was found.
[realsense2_camera_node-2] 
[realsense2_camera_node-2] [INFO] [1729853013.612447756] [camera_rear]: Device with physical ID 2-2-33 was found.
[realsense2_camera_node-2] [INFO] [1729853013.612456297] [camera_rear]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-2] [INFO] [1729853013.612596975] [camera_rear]: Device with port number 2-2 was found.
[realsense2_camera_node-2] [INFO] [1729853013.612606309] [camera_rear]: Device USB type: 3.2
[realsense2_camera_node-2] [INFO] [1729853013.612613743] [camera_rear]: Resetting device...
[realsense2_camera_node-1] [INFO] [1729853013.629443914] [camera_front]: Device with serial number 025222070751 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1729853013.629495839] [camera_front]: Device with physical ID 2-4-32 was found.
[realsense2_camera_node-1] [INFO] [1729853013.629508158] [camera_front]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1729853013.629653194] [camera_front]: Device with port number 2-4 was found.
[realsense2_camera_node-1] [INFO] [1729853013.629667679] [camera_front]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1729853013.629677480] [camera_front]: Resetting device...
[realsense2_camera_node-1]  25/10 12:43:39,661 WARNING [137682726422080] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:39,671 WARNING [137682726422080] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:39,684 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:39,685 WARNING [137682726422080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Device or resource busy, number: 16
[realsense2_camera_node-2]  25/10 12:43:39,694 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:39,696 WARNING [137682726422080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Device or resource busy, number: 16
[realsense2_camera_node-2]  25/10 12:43:39,705 ERROR [134280910997056] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-2]  25/10 12:43:39,705 ERROR [134281133295168] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-2]  25/10 12:43:39,705 WARNING [134281133295168] (d400-factory.cpp:793) Cannot read RGB calibration table
[realsense2_camera_node-2]  25/10 12:43:39,705 WARNING [134281133295168] (d400-factory.cpp:909) invalid RGB extrinsic was identified, recovery routine was invoked
[realsense2_camera_node-2]  25/10 12:43:39,705 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:39,715 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:39,725 ERROR [134280910997056] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-2]  25/10 12:43:39,725 ERROR [134281133295168] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-2]  25/10 12:43:39,725 ERROR [134281133295168] (d400-factory.cpp:948) RGB Extrinsic recovery routine failed
[realsense2_camera_node-2]  25/10 12:43:39,725 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:39,741 WARNING [137682726422080] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2] [INFO] [1729853019.748980144] [camera_rear]: Device with serial number 031522070524 was found.
[realsense2_camera_node-2] 
[realsense2_camera_node-2] [INFO] [1729853019.749024358] [camera_rear]: Device with physical ID 2-2-34 was found.
[realsense2_camera_node-2] [INFO] [1729853019.749030704] [camera_rear]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-2] [INFO] [1729853019.749155078] [camera_rear]: Device with port number 2-2 was found.
[realsense2_camera_node-2] [INFO] [1729853019.749163868] [camera_rear]: Device USB type: 3.2
[realsense2_camera_node-2] [INFO] [1729853019.749223274] [camera_rear]: getParameters...
[realsense2_camera_node-2] [WARN] [1729853019.749403222] [camera_rear]: For the 'unite_imu_method' param update to take effect, re-enable either gyro or accel stream.
[realsense2_camera_node-1]  25/10 12:43:39,752 WARNING [137682726422080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Device or resource busy, number: 16
[realsense2_camera_node-2] [INFO] [1729853019.757697632] [camera_rear]: Publish diagnostics every 1 seconds.
[realsense2_camera_node-2] [INFO] [1729853019.759254172] [camera_rear]: JSON file is not provided
[realsense2_camera_node-2] [INFO] [1729853019.759272218] [camera_rear]: Device Name: Intel RealSense D435I
[realsense2_camera_node-2] [INFO] [1729853019.759278263] [camera_rear]: Device Serial No: 031522070524
[realsense2_camera_node-2] [INFO] [1729853019.759283056] [camera_rear]: Device physical port: 2-2-34
[realsense2_camera_node-2] [INFO] [1729853019.759287241] [camera_rear]: Device FW version: 5.16.0.1
[realsense2_camera_node-2] [INFO] [1729853019.759294085] [camera_rear]: Device Product ID: 0x0B3A
[realsense2_camera_node-2] [INFO] [1729853019.759298092] [camera_rear]: Sync Mode: On
[realsense2_camera_node-2]  25/10 12:43:39,759 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-2]  25/10 12:43:39,769 WARNING [134280910997056] (handle-libusb.h:110) failed to claim usb interface, interface 0, is busy - retrying...
[realsense2_camera_node-1]  25/10 12:43:39,774 WARNING [137682726422080] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Device or resource busy, number: 16
[realsense2_camera_node-2]  25/10 12:43:39,779 ERROR [134280910997056] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_BUSY
[realsense2_camera_node-2]  25/10 12:43:39,779 ERROR [134281133295168] (uvc-sensor.cpp:427) acquire_power failed: failed to set power state
[realsense2_camera_node-2]  25/10 12:43:39,779 WARNING [134281133295168] (hdr-config.cpp:398) In hdr_config::disable() - hw command failed: std::exception
[realsense2_camera_node-1] [INFO] [1729853019.797054135] [camera_front]: Device with serial number 031522070524 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1729853019.797106862] [camera_front]: Device with physical ID 2-2-34 was found.
[realsense2_camera_node-1] [INFO] [1729853019.797119669] [camera_front]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1729853019.797279120] [camera_front]: Device with port number 2-2 was found.
[realsense2_camera_node-1] [INFO] [1729853019.927138822] [camera_front]: Device with serial number 025222070751 was found.
[realsense2_camera_node-1] 
[realsense2_camera_node-1] [INFO] [1729853019.927260774] [camera_front]: Device with physical ID 2-4-35 was found.
[realsense2_camera_node-1] [INFO] [1729853019.927279507] [camera_front]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-1] [INFO] [1729853019.927725204] [camera_front]: Device with port number 2-4 was found.
[realsense2_camera_node-1] [INFO] [1729853019.927746203] [camera_front]: Device USB type: 3.2
[realsense2_camera_node-1] [INFO] [1729853019.927845878] [camera_front]: getParameters...
[realsense2_camera_node-1] [WARN] [1729853019.928482404] [camera_front]: For the 'unite_imu_method' param update to take effect, re-enable either gyro or accel stream.
[realsense2_camera_node-1] [INFO] [1729853019.928539890] [camera_front]: Publish diagnostics every 1 seconds.
[realsense2_camera_node-1] [INFO] [1729853019.931712942] [camera_front]: JSON file is not provided
[realsense2_camera_node-1] [INFO] [1729853019.931765354] [camera_front]: Device Name: Intel RealSense D435I
[realsense2_camera_node-1] [INFO] [1729853019.931782279] [camera_front]: Device Serial No: 025222070751
[realsense2_camera_node-1] [INFO] [1729853019.931795539] [camera_front]: Device physical port: 2-4-35
[realsense2_camera_node-1] [INFO] [1729853019.931807653] [camera_front]: Device FW version: 5.16.0.1
[realsense2_camera_node-1] [INFO] [1729853019.931818657] [camera_front]: Device Product ID: 0x0B3A
[realsense2_camera_node-1] [INFO] [1729853019.931830133] [camera_front]: Sync Mode: On
[realsense2_camera_node-2]  25/10 12:43:40,285 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2]  25/10 12:43:40,309 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2]  25/10 12:43:40,333 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2] [WARN] [1729853020.444587774] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1729853020.445050432] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1729853020.445390256] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1729853020.510664497] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1729853020.510722721] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1729853020.511084486] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [INFO] [1729853020.511543626] [camera_rear]: Set ROS param gyro_fps to default: 200
[realsense2_camera_node-2] [INFO] [1729853020.511585810] [camera_rear]: Set ROS param accel_fps to default: 63
[realsense2_camera_node-2] [WARN] [1729853020.514109924] [camera_rear]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [INFO] [1729853020.515901524] [camera_rear]: Stopping Sensor: Depth Module
[realsense2_camera_node-2] [INFO] [1729853020.515947657] [camera_rear]: Stopping Sensor: RGB Camera
[realsense2_camera_node-2] [INFO] [1729853020.515958179] [camera_rear]: Stopping Sensor: Motion Module
[realsense2_camera_node-2] [INFO] [1729853020.557043259] [camera_rear]: Starting Sensor: Depth Module
[realsense2_camera_node-2] [INFO] [1729853020.578078118] [camera_rear]: Open profile: stream_type: Infra(1), Format: Y8, Width: 1280, Height: 720, FPS: 15
[realsense2_camera_node-2] [INFO] [1729853020.578112293] [camera_rear]: Open profile: stream_type: Infra(2), Format: Y8, Width: 1280, Height: 720, FPS: 15
[realsense2_camera_node-2] [INFO] [1729853020.578118807] [camera_rear]: Open profile: stream_type: Depth(0), Format: Z16, Width: 1280, Height: 720, FPS: 15
[realsense2_camera_node-2]  25/10 12:43:40,578 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2] [INFO] [1729853020.579289207] [camera_rear]: Starting Sensor: RGB Camera
[realsense2_camera_node-2] [INFO] [1729853020.588850850] [camera_rear]: Open profile: stream_type: Color(0), Format: RGB8, Width: 1280, Height: 720, FPS: 15
[realsense2_camera_node-2]  25/10 12:43:40,588 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2]  25/10 12:43:40,599 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-1] [WARN] [1729853020.605421276] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [WARN] [1729853020.605855086] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [WARN] [1729853020.606146339] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2]  25/10 12:43:40,609 WARNING [134281133295168] (ds-calib-parsers.cpp:35) IMU Calibration is not available, default intrinsic and extrinsic will be used.
[realsense2_camera_node-2] [INFO] [1729853020.610499507] [camera_rear]: Starting Sensor: Motion Module
[realsense2_camera_node-2] [INFO] [1729853020.672790975] [camera_rear]: Open profile: stream_type: Accel(0)Format: MOTION_XYZ32F, FPS: 63
[realsense2_camera_node-2] [INFO] [1729853020.672841051] [camera_rear]: Open profile: stream_type: Gyro(0)Format: MOTION_XYZ32F, FPS: 200
[realsense2_camera_node-2] [INFO] [1729853020.695185366] [camera_rear]: RealSense Node Is Up!
[realsense2_camera_node-1] [WARN] [1729853020.697092027] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [WARN] [1729853020.697123553] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [WARN] [1729853020.697497139] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1729853020.698003887] [camera_front]: Set ROS param gyro_fps to default: 200
[realsense2_camera_node-1] [INFO] [1729853020.698049424] [camera_front]: Set ROS param accel_fps to default: 63
[realsense2_camera_node-2]  25/10 12:43:40,699 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-1] [WARN] [1729853020.700038189] [camera_front]: re-enable the stream for the change to take effect.
[realsense2_camera_node-1] [INFO] [1729853020.701382713] [camera_front]: Stopping Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1729853020.701430551] [camera_front]: Stopping Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1729853020.701442123] [camera_front]: Stopping Sensor: Motion Module
[realsense2_camera_node-1] [INFO] [1729853020.737493191] [camera_front]: Starting Sensor: Depth Module
[realsense2_camera_node-1]  25/10 12:43:40,759 WARNING [137682938234432] (messenger-libusb.cpp:92) usb_request_queue returned error, endpoint: 131 error: Cannot allocate memory, number: 12
[realsense2_camera_node-1]  25/10 12:43:40,759 ERROR [137682938234432] (dispatcher.cpp:34) Dispatcher [0x7d38b0200b98] exception caught: failed to submit UVC request while start streaming
[realsense2_camera_node-2]  25/10 12:43:40,910 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2]  25/10 12:43:40,920 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-2]  25/10 12:43:40,930 WARNING [134280910997056] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
[realsense2_camera_node-1]  25/10 12:43:40,951 WARNING [137682959205952] (uvc-sensor.cpp:131) Frame received with streaming inactive,Depth0, Arrived,0.000000 1729853020951.875244
[realsense2_camera_node-1]  25/10 12:43:41,018 WARNING [137682959205952] (uvc-sensor.cpp:131) Frame received with streaming inactive,Depth0, Arrived,0.000000 1729853021018.471680

These are the parameters I am using :

configurable_parameters = [
    {"name": "camera_name", "default": "camera", "description": "camera unique name"},
    {"name": "camera_namespace", "default": "", "description": "namespace for camera"},
    {"name": "serial_no", "default": "''", "description": "choose device by serial number"},
    {"name": "usb_port_id", "default": "''", "description": "choose device by usb port id"},
    {"name": "device_type", "default": "''", "description": "choose device by type"},
    {"name": "config_file", "default": "''", "description": "yaml config file"},
    {"name": "json_file_path", "default": "''", "description": "allows advanced configuration"},
    {"name": "initial_reset", "default": "true", "description": "''"},
    {"name": "accelerate_gpu_with_glsl", "default": "false", "description": "enable GPU acceleration with GLSL"},
    {"name": "rosbag_filename", "default": "''", "description": "A realsense bagfile to run from as a device"},
    {"name": "log_level", "default": "info", "description": "debug log level [DEBUG|INFO|WARN|ERROR|FATAL]"},
    {"name": "output", "default": "screen", "description": "pipe node output [screen|log]"},
    {"name": "enable_color", "default": "true", "description": "enable color stream"},
    {"name": "rgb_camera.color_profile", "default": "1280,720,15", "description": "color stream profile"},
    {"name": "rgb_camera.color_format", "default": "RGB8", "description": "color stream format"},
    {"name": "rgb_camera.enable_auto_exposure", "default": "true", "description": "enable/disable auto exposure for color image"},
    {"name": "enable_depth", "default": "true", "description": "enable depth stream"},
    {"name": "enable_infra", "default": "false", "description": "enable infra0 stream"},
    {"name": "enable_infra1", "default": "true", "description": "enable infra1 stream"},
    {"name": "enable_infra2", "default": "true", "description": "enable infra2 stream"},
    {"name": "depth_module.depth_profile", "default": "1280,720,15", "description": "depth stream profile"},
    {"name": "depth_module.depth_format", "default": "Z16", "description": "depth stream format"},
    {"name": "depth_module.infra_profile", "default": "1280,720,15", "description": "infra streams (0/1/2) profile"},
    {"name": "depth_module.infra_format", "default": "RGB8", "description": "infra0 stream format"},
    {"name": "depth_module.infra1_format", "default": "Y8", "description": "infra1 stream format"},
    {"name": "depth_module.infra2_format", "default": "Y8", "description": "infra2 stream format"},
    {"name": "depth_module.exposure", "default": "8500", "description": "Depth module manual exposure value"},
    {"name": "depth_module.gain", "default": "16", "description": "Depth module manual gain value"},
    {"name": "depth_module.hdr_enabled", "default": "false", "description": "Depth module hdr enablement flag. Used for hdr_merge filter"},
    {"name": "depth_module.enable_auto_exposure", "default": "true", "description": "enable/disable auto exposure for depth image"},
    {"name": "depth_module.exposure.1", "default": "7500", "description": "Depth module first exposure value. Used for hdr_merge filter"},
    {"name": "depth_module.gain.1", "default": "16", "description": "Depth module first gain value. Used for hdr_merge filter"},
    {"name": "depth_module.exposure.2", "default": "1", "description": "Depth module second exposure value. Used for hdr_merge filter"},
    {"name": "depth_module.gain.2", "default": "16", "description": "Depth module second gain value. Used for hdr_merge filter"},
    {"name": "depth_module.emitter_on_off", "default": "false", "description": "Depth module second gain value. Used for hdr_merge filter"},
    {"name": "depth_module.laser_power", "default": "0.0", "description": "enable infra2 stream"},
    {"name": "enable_sync", "default": "true", "description": "'enable sync mode'"},
    {"name": "enable_rgbd", "default": "false", "description": "'enable rgbd topic'"},
    {"name": "enable_gyro", "default": "true", "description": "'enable gyro stream'"},
    {"name": "enable_accel", "default": "true", "description": "'enable accel stream'"},
    {"name": "gyro_fps", "default": "0", "description": "''"},
    {"name": "accel_fps", "default": "0", "description": "''"},
    {"name": "unite_imu_method", "default": "2", "description": "[0-None, 1-copy, 2-linear_interpolation]"},
    {"name": "clip_distance", "default": "-2.", "description": "''"},
    {"name": "angular_velocity_cov", "default": "0.01", "description": "''"},
    {"name": "linear_accel_cov", "default": "0.01", "description": "''"},
    {"name": "diagnostics_period", "default": "0.0", "description": "Rate of publishing diagnostics. 0=Disabled"},
    {"name": "publish_tf", "default": "true", "description": "[bool] enable/disable publishing static & dynamic TF"},
    {"name": "tf_publish_rate", "default": "0.0", "description": "[double] rate in Hz for publishing dynamic TF"},
    {"name": "pointcloud.enable", "default": "true", "description": ""},
    {"name": "pointcloud.stream_filter", "default": "2", "description": "texture stream for pointcloud"},
    {"name": "pointcloud.stream_index_filter", "default": "0", "description": "texture stream index for pointcloud"},
    {"name": "pointcloud.ordered_pc", "default": "false", "description": ""},
    {"name": "pointcloud.allow_no_texture_points", "default": "false", "description": "''"},
    {"name": "align_depth.enable", "default": "true", "description": "enable align depth filter"},
    {"name": "colorizer.enable", "default": "false", "description": "enable colorizer filter"},
    {"name": "decimation_filter.enable", "default": "false", "description": "enable_decimation_filter"},
    {"name": "spatial_filter.enable", "default": "false", "description": "enable_spatial_filter"},
    {"name": "temporal_filter.enable", "default": "false", "description": "enable_temporal_filter"},
    {"name": "disparity_filter.enable", "default": "false", "description": "enable_disparity_filter"},
    {"name": "hole_filling_filter.enable", "default": "false", "description": "enable_hole_filling_filter"},
    {"name": "hdr_merge.enable", "default": "false", "description": "hdr_merge filter enablement flag"},
    {"name": "wait_for_device_timeout", "default": "-1.", "description": "Timeout for waiting for device to connect (Seconds)"},
    {"name": "reconnect_timeout", "default": "6.", "description": "Timeout(seconds) between consequtive reconnection attempts"},
]

After receiving this error WARNING [137682959205952] (uvc-sensor.cpp:131) Frame received with streaming inactive,Depth0, Arrived,0.000000 1729853021018.471680 the images are no longer published for that camera.

@MartyG-RealSense
Copy link
Collaborator

Hi @kushal2507 If you are launching with 2 cameras then I would recommend using the rs_multi_camera_launch.py launch file instead of rs_launch.py, or launching each camera with an rs_launch.py instruction for each individual camera in two separate terminal windows.

https://github.com/IntelRealSense/realsense-ros/blob/ros2-master/realsense2_camera/launch/rs_multi_camera_launch.py

If your preference is to launch with a single rs_launch.py instruction then you can define a separate camera_name for each camera to ensure that the launch can correctly tell the two cameras apart.

https://github.com/IntelRealSense/realsense-ros/tree/ros2-master?tab=readme-ov-file#camera-name-and-camera-namespace

@kushal2507
Copy link
Author

hi @MartyG-RealSense I have my custom launch file, it is laucnhing the two cameras with different names,

Main launch file

# Copyright 2023 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# DESCRIPTION #
# ----------- #
# Use this launch file to launch a device and get the params from a YAML file.
# The Parameters available for definition in the command line for the camera are described in rs_launch.configurable_parameters
# command line example:
# ros2 launch realsense2_camera rs_launch_get_params_from_yaml.py

"""Launch realsense2_camera node."""
import os
import copy
from launch import LaunchDescription
from launch.actions import OpaqueFunction
from launch.substitutions import LaunchConfiguration
import sys
import pathlib
from ament_index_python.packages import get_package_share_directory

sys.path.append(str(pathlib.Path(__file__).parent.absolute()))
import realsense_launch  # noqa: E402

sys.path.append(os.path.join(get_package_share_directory("bgl_hardware_launcher"), "launch"))

params_file1 = os.path.join(
    get_package_share_directory("bgl_hardware_launcher"),
    "config",
    "realsense_front.yaml",
)
params_file2 = os.path.join(
    get_package_share_directory("bgl_hardware_launcher"),
    "config",
    "realsense_rear.yaml",
)

local_parameters = [
    {
        "name": "camera_name1",
        "default": "camera_front",
        "description": "camera unique name",
    },
    {
        "name": "camera_name2",
        "default": "camera_rear",
        "description": "camera unique name",
    },
    {
        "name": "config_file1",
        "default": [params_file1],
        "description": "yaml config file",
    },
    {
        "name": "config_file2",
        "default": [params_file2],
        "description": "yaml config file",
    },
]


def set_configurable_parameters(local_params):
    return dict([(param["original_name"], LaunchConfiguration(param["name"])) for param in local_params])


def duplicate_params(general_params, posix):
    local_params = copy.deepcopy(general_params)
    for param in local_params:
        param["original_name"] = param["name"]
        param["name"] += posix
    return local_params


def generate_launch_description():
    params1 = duplicate_params(realsense_launch.configurable_parameters, "1")
    params2 = duplicate_params(realsense_launch.configurable_parameters, "2")

    return LaunchDescription(
        realsense_launch.declare_configurable_parameters(local_parameters)
        + realsense_launch.declare_configurable_parameters(params1)
        + realsense_launch.declare_configurable_parameters(params2)
        + [
            OpaqueFunction(
                function=realsense_launch.launch_setup,
                kwargs={
                    "params": set_configurable_parameters(params1),
                    "param_name_suffix": "1",
                },
            ),
            OpaqueFunction(
                function=realsense_launch.launch_setup,
                kwargs={
                    "params": set_configurable_parameters(params2),
                    "param_name_suffix": "2",
                },
            ),
        ]
    )

python file with properties being loaded from the main launch file

# Copyright 2023 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Launch realsense2_camera node."""
import os
import yaml
from launch import LaunchDescription
import launch_ros.actions
from launch.actions import DeclareLaunchArgument, OpaqueFunction
from launch.substitutions import LaunchConfiguration


configurable_parameters = [
    {"name": "camera_name", "default": "camera", "description": "camera unique name"},
    {"name": "camera_namespace", "default": "", "description": "namespace for camera"},
    {"name": "serial_no", "default": "''", "description": "choose device by serial number"},
    {"name": "usb_port_id", "default": "''", "description": "choose device by usb port id"},
    {"name": "device_type", "default": "''", "description": "choose device by type"},
    {"name": "config_file", "default": "''", "description": "yaml config file"},
    {"name": "json_file_path", "default": "''", "description": "allows advanced configuration"},
    {"name": "initial_reset", "default": "true", "description": "''"},
    {"name": "accelerate_gpu_with_glsl", "default": "false", "description": "enable GPU acceleration with GLSL"},
    {"name": "rosbag_filename", "default": "''", "description": "A realsense bagfile to run from as a device"},
    {"name": "log_level", "default": "info", "description": "debug log level [DEBUG|INFO|WARN|ERROR|FATAL]"},
    {"name": "output", "default": "screen", "description": "pipe node output [screen|log]"},
    {"name": "enable_color", "default": "true", "description": "enable color stream"},
    {"name": "rgb_camera.color_profile", "default": "1280,720,15", "description": "color stream profile"},
    {"name": "rgb_camera.color_format", "default": "RGB8", "description": "color stream format"},
    {"name": "rgb_camera.enable_auto_exposure", "default": "true", "description": "enable/disable auto exposure for color image"},
    {"name": "enable_depth", "default": "true", "description": "enable depth stream"},
    {"name": "enable_infra", "default": "false", "description": "enable infra0 stream"},
    {"name": "enable_infra1", "default": "true", "description": "enable infra1 stream"},
    {"name": "enable_infra2", "default": "true", "description": "enable infra2 stream"},
    {"name": "depth_module.depth_profile", "default": "1280,720,15", "description": "depth stream profile"},
    {"name": "depth_module.depth_format", "default": "Z16", "description": "depth stream format"},
    {"name": "depth_module.infra_profile", "default": "1280,720,15", "description": "infra streams (0/1/2) profile"},
    {"name": "depth_module.infra_format", "default": "RGB8", "description": "infra0 stream format"},
    {"name": "depth_module.infra1_format", "default": "Y8", "description": "infra1 stream format"},
    {"name": "depth_module.infra2_format", "default": "Y8", "description": "infra2 stream format"},
    {"name": "depth_module.exposure", "default": "8500", "description": "Depth module manual exposure value"},
    {"name": "depth_module.gain", "default": "16", "description": "Depth module manual gain value"},
    {"name": "depth_module.hdr_enabled", "default": "false", "description": "Depth module hdr enablement flag. Used for hdr_merge filter"},
    {"name": "depth_module.enable_auto_exposure", "default": "true", "description": "enable/disable auto exposure for depth image"},
    {"name": "depth_module.exposure.1", "default": "7500", "description": "Depth module first exposure value. Used for hdr_merge filter"},
    {"name": "depth_module.gain.1", "default": "16", "description": "Depth module first gain value. Used for hdr_merge filter"},
    {"name": "depth_module.exposure.2", "default": "1", "description": "Depth module second exposure value. Used for hdr_merge filter"},
    {"name": "depth_module.gain.2", "default": "16", "description": "Depth module second gain value. Used for hdr_merge filter"},
    {"name": "depth_module.emitter_on_off", "default": "false", "description": "Depth module second gain value. Used for hdr_merge filter"},
    {"name": "depth_module.laser_power", "default": "0.0", "description": "enable infra2 stream"},
    {"name": "enable_sync", "default": "true", "description": "'enable sync mode'"},
    {"name": "enable_rgbd", "default": "false", "description": "'enable rgbd topic'"},
    {"name": "enable_gyro", "default": "true", "description": "'enable gyro stream'"},
    {"name": "enable_accel", "default": "true", "description": "'enable accel stream'"},
    {"name": "gyro_fps", "default": "0", "description": "''"},
    {"name": "accel_fps", "default": "0", "description": "''"},
    {"name": "unite_imu_method", "default": "2", "description": "[0-None, 1-copy, 2-linear_interpolation]"},
    {"name": "clip_distance", "default": "-2.", "description": "''"},
    {"name": "angular_velocity_cov", "default": "0.01", "description": "''"},
    {"name": "linear_accel_cov", "default": "0.01", "description": "''"},
    {"name": "diagnostics_period", "default": "0.0", "description": "Rate of publishing diagnostics. 0=Disabled"},
    {"name": "publish_tf", "default": "true", "description": "[bool] enable/disable publishing static & dynamic TF"},
    {"name": "tf_publish_rate", "default": "0.0", "description": "[double] rate in Hz for publishing dynamic TF"},
    {"name": "pointcloud.enable", "default": "true", "description": ""},
    {"name": "pointcloud.stream_filter", "default": "2", "description": "texture stream for pointcloud"},
    {"name": "pointcloud.stream_index_filter", "default": "0", "description": "texture stream index for pointcloud"},
    {"name": "pointcloud.ordered_pc", "default": "false", "description": ""},
    {"name": "pointcloud.allow_no_texture_points", "default": "false", "description": "''"},
    {"name": "align_depth.enable", "default": "true", "description": "enable align depth filter"},
    {"name": "colorizer.enable", "default": "false", "description": "enable colorizer filter"},
    {"name": "decimation_filter.enable", "default": "false", "description": "enable_decimation_filter"},
    {"name": "spatial_filter.enable", "default": "false", "description": "enable_spatial_filter"},
    {"name": "temporal_filter.enable", "default": "false", "description": "enable_temporal_filter"},
    {"name": "disparity_filter.enable", "default": "false", "description": "enable_disparity_filter"},
    {"name": "hole_filling_filter.enable", "default": "false", "description": "enable_hole_filling_filter"},
    {"name": "hdr_merge.enable", "default": "false", "description": "hdr_merge filter enablement flag"},
    {"name": "wait_for_device_timeout", "default": "-1.", "description": "Timeout for waiting for device to connect (Seconds)"},
    {"name": "reconnect_timeout", "default": "6.", "description": "Timeout(seconds) between consequtive reconnection attempts"},
]


def declare_configurable_parameters(parameters):
    return [DeclareLaunchArgument(param["name"], default_value=param["default"], description=param["description"]) for param in parameters]


def set_configurable_parameters(parameters):
    return dict([(param["name"], LaunchConfiguration(param["name"])) for param in parameters])


def yaml_to_dict(path_to_yaml):
    with open(path_to_yaml, "r") as f:
        return yaml.load(f, Loader=yaml.SafeLoader)


def launch_setup(context, params, param_name_suffix=""):
    _config_file = LaunchConfiguration("config_file" + param_name_suffix).perform(context)
    params_from_file = {} if _config_file == "''" else yaml_to_dict(_config_file)

    _output = LaunchConfiguration("output" + param_name_suffix)
    if os.getenv("ROS_DISTRO") == "foxy":
        # Foxy doesn't support output as substitution object (LaunchConfiguration object)
        # but supports it as string, so we fetch the string from this substitution object
        # see related PR that was merged for humble, iron, rolling: https://github.com/ros2/launch/pull/577
        _output = context.perform_substitution(_output)

    return [
        launch_ros.actions.Node(
            package="realsense2_camera",
            namespace=LaunchConfiguration("camera_namespace" + param_name_suffix),
            name=LaunchConfiguration("camera_name" + param_name_suffix),
            executable="realsense2_camera_node",
            parameters=[params, params_from_file],
            output=_output,
            arguments=["--ros-args", "--log-level", LaunchConfiguration("log_level" + param_name_suffix)],
            emulate_tty=True,
            remappings=[
                (
                    "/camera_front/infra1/camera_info",
                    "/camera_front/left/camera_info",
                ),
                (
                    "/camera_front/color/camera_info",
                    "/camera_front/rgb/camera_info",
                ),
                (
                    "/camera_rear/color/camera_info",
                    "/camera_rear/rgb/camera_info",
                ),
                (
                    "/camera_front/color/image_raw",
                    "/camera_front/rgb/image_raw",
                ),
                (
                    "/camera_rear/color/image_raw",
                    "/camera_rear/rgb/image_raw",
                ),
                (
                    "/camera_front/depth/color/points",
                    "/camera_front/points",
                ),
                (
                    "/camera_rear/depth/color/points",
                    "/camera_rear/points",
                ),
                (
                    "/camera_front/depth/image_rect_raw",
                    "/camera_front/depth/image_raw",
                ),
                (
                    "/camera_rear/depth/image_rect_raw",
                    "/camera_rear/depth/image_raw",
                ),
                (
                    "/camera_front/infra1/image_rect_raw",
                    "/camera_front/left/image_rect_raw",
                ),
                (
                    "/camera_front/infra2/camera_info",
                    "/camera_front/right/camera_info",
                ),
                (
                    "/camera_front/infra2/image_rect_raw",
                    "/camera_front/right/image_rect_raw",
                ),
                (
                    "/camera_rear/infra1/camera_info",
                    "/camera_rear/left/camera_info",
                ),
                (
                    "/camera_rear/infra1/image_rect_raw",
                    "/camera_rear/left/image_rect_raw",
                ),
                (
                    "/camera_rear/infra2/camera_info",
                    "/camera_rear/right/camera_info",
                ),
                (
                    "/camera_rear/infra2/image_rect_raw",
                    "/camera_rear/right/image_rect_raw",
                ),
            ],
        )
    ]


def generate_launch_description():
    return LaunchDescription(
        declare_configurable_parameters(configurable_parameters)
        + [OpaqueFunction(function=launch_setup, kwargs={"params": set_configurable_parameters(configurable_parameters)})]
    )

The two yaml files that you see in the launch.py file, adds unique serial numbers to each camera

@MartyG-RealSense
Copy link
Collaborator

Do the two cameras launch correctly if rs_multi_camera_launch.py is used (this launch file automatically configures the separate camera settings). If it does launch the two cameras without problems then it could indicate that there is an issue somewhere in your custom launch system.

Usually, only one yaml file is imported into a RealSense ROS launch and I have not seen a previous case where two yaml files were imported, so there is no previous precedent to confirm whether it can work.

Would it be possible to simplify the system by defining the configs for both cameras in a single yaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants