Azure_Kinect_ROS_Driver
Azure_Kinect_ROS_Driver copied to clipboard
Driver hangs forever if initial open failed
Describe the bug If at the end of constructor of K4AROSDevice k4a_device_ is still nullptr, a ROS_ERROR is outputted, but the node is not shut down. This leads to a 'hanging' node. This error occurres, if multiple drivers are launched at the same time.
As every driver claims the device exclusive then checks the serial, and afterwards releases the device if the serial is not the correct one, it blocks other processes from opening the device during this time. The second driver will then skip the device, as k4a::device::open failed, and end up with no device at all.
To Reproduce Steps to reproduce the behavior:
- Have multiple cameras connected
- Start multiple nodes in parallel
- Repeat until one driver gives the output 'Failed to open a K4A device. Cannot continue.'
Expected behavior In this case the node should shut down.
Note, I got a merge request ready for fixing this issue.
Related issue about opening multiple devices in parallel: https://github.com/microsoft/Azure_Kinect_ROS_Driver/issues/97.
ping ?
Hi All, There is a backlog item about supporting multiple camera setups - https://github.com/microsoft/Azure_Kinect_ROS_Driver/issues/126. However, we have not funded this internally due to resource constraints. If you have a fix for this, a PR would be greatly appreciated!