IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.51k stars 1.74k forks source link

Multiple Camera #1515

Closed BunnyIcon closed 3 years ago

BunnyIcon commented 3 years ago

I'm a beginner with computer vision and embedded control. I'm doing a robot project that needs 6 cameras (six D435i or one D435i and five T265). I'm using Jetson AGX Xavier kits. It provides 3 usb3.0. I want to know how to increase the USB ports so that I could use more cameras. I tried with miniPCIE, and USB HUB, but neither works. (I can open camera with python-opencv, but cannot open with realsense ros wrapper. I want to use cameras in ros)

Do I need a powered USB hub? And how many cameras can be processed at most by Jetson AGX Xavier?

Thanks in advance!

RealSenseSupport commented 3 years ago

@BunnyIcon, please give multi-camera launch file a try. Make sure you supply the correct camera SN accordingly. https://github.com/IntelRealSense/realsense-ros#work-with-multiple-camera Other users also have reported successful experience of running multiple RealSense cameras with PCIe card on AGX Xavier. Ref: https://github.com/IntelRealSense/realsense-ros/issues/1018#issuecomment-584950118

BunnyIcon commented 3 years ago

@RealSenseSupport

Thanks for your help. I tried multi device launch file, and got one more problem: when I used 6 D435i simultaneously, it often turns out some (one or two or three) cameras cannot publish /color/ topics. But after a period of time, when used alone, each camera can publish all topics. Sometimes this problem occurs, sometimes not. It seems quite unstable.

I'm using 2 USB hubs with power (3 cameras on one hub): https://detail.tmall.com/item.htm?id=599038479527&spm=a1z09.2.0.0.47902e8dApIilm&_u=u2a12faqaa76&sku_properties=148242406:21516 (The link may be in Chinese, sry for hard to read)

Do you have any ideas for the unstable reason? Thanks in advance.

RealSenseSupport commented 3 years ago

@BunnyIcon, was the librealsense built using RSUSB backend or the native v4l backend? For multi camera configuration, please build the library using the native backend. See the RSUSB limitation here.

BunnyIcon commented 3 years ago

@RealSenseSupport That might be the point! How could I check whether I built using RSUSB backend?

darshb34 commented 3 years ago

@RealSenseSupport

1.) I have same issue on same platform, I installed via sudo apt-get install ros-melodic-realsense2-camera (it automatically installs librealsense). Does that install as native v4l backend?

2.) I have two robots with same setup and same installation process for ros-melodic-realsense2-camera, but in one of them I have v4l paths for rs cams and not in the other one.

Please share your thoughts

RealSenseSupport commented 3 years ago

Please check the message generated by the RealSense Viewer log which shows the backend information. rs_log_native_vs_rsusb For information on how to build the libRealSense with native backend, please use v2.40.0 and the instruction provided here: https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md#building-from-source-using-native-backend

doronhi commented 3 years ago

As for now, installation using apt-get install ros-melodic-realsense2-camera install a version of librealsense2 that uses RSUSB, not v4l.

RealSenseSupport commented 3 years ago

Please let us know if more help is needed. Thank you.