microsoft / Azure_Kinect_ROS_Driver

A ROS sensor driver for the Azure Kinect Developer Kit.
MIT License
295 stars 220 forks source link

How to use ROS-Driver to drive multiple kinects? #236

Closed 2361098148 closed 2 years ago

2361098148 commented 2 years ago

I tried to drive two kinects simultaneously, how should I do?

ooeygui commented 2 years ago

The ROS node does not currently support multiple Kinects on one system very well; it can be made to function by having multiple nodes launch each connecting by device ID in the launch file for each ROS node. Additionally, the Kinect is very sensitive to the USB host controller and drivers, so each Kinect should be on a separate USB Bus. Between these two facts, when multiple Kinects are required, then multiple computers are recommended.

2361098148 commented 2 years ago

Thanks a lot for your answer at first, and I have another two questions according to your reply. Firstly, I stick to open two kinects in one computer, if I need to roslaunch two ROS-Driver simultaneously with the different device ID? I'd appreciate it if you can give me more information such as an example code or instruction. Secondly, it seems like we could use SDK to merge two Kinects' information. What should I do if I want to accomplish a similar function by ROS-Driver? If I need to get the relative posture of the Kinects manually and merge the point cloud by ICP algorithm? Is there some example code?

ooeygui commented 2 years ago

Here is the original feature request to support multiple camera setups, including pointcloud fusion - https://github.com/microsoft/Azure_Kinect_ROS_Driver/issues/126. The sample launch file is currently optimized for single instance with no namespace support. It does have parameters sensor_sn, which allows you to specify the serial number of a kinect for that specific driver to bind to, and tf_refix so you can link each into a urdf. You'll have to use the Kinect SDK to find the serial number for a specific device. In order to launch multiple devices you can import this launch file into another launch file and add a namespace around it.

2361098148 commented 2 years ago

Thanks a lot! After your instruction, i have tried this way:

I learned it from #97, but I met similar subsequent problems as well. It seemed like both Kinects worked, but only the first Kinect's data could be obtained. It is strange because we could receive the second Kinect's coordinate system in Rviz without more data. So I opened rqt_graph and found that it seemed like that both Kinects published the data on the same topic. So I doubt that if I need to apply distinct topic's name to different cameras? Or should I alter the launch file in another way?

ooeygui commented 2 years ago

Duplicating to the official support for multi-camera https://github.com/microsoft/Azure_Kinect_ROS_Driver/issues/126