orbbec/ros_astra_camera

Failed to initialize UVC camera: Can't open /dev/bus/usb//

BrendanWooAdmetal opened this issue · 4 comments

Launching the Orbbec Astra Pro Plus using astra_pro_plus.launch fails sometimes.
The cause is unknown, but originates with libuvc.

Hardware information
ROS Noetic
Ubuntu 20.04
origin/main
libuvc built from source (v0.0.7) originally, then attempted with it installed via apt (v0.0.6-1).

Error information:

The following error message will print:

: Not supported (-12)51756019]: Can't open /dev/bus/usb//
: Not supported (-12)58307550]: Failed to initialize UVC camera: Can't open /dev/bus/usb//

This error originates on line 252 in ros_astra_camera/src/uvc_camera_driver.cpp
In the error message above, the format is supposed to be /dev/bus/usb/busNumber/deviceAddress.
However, no bus number and device address are found.
These errors are printed as the result of a failure in uvc_open().

Potential fix/workaround:

For unknown reasons, plugging in and running a different Astra Pro Plus seemed to work, and after running the other Astra, the one experiencing the problems will work again.

Don’t know why this works, but it has fixed it twice.
I can't prove it wasn't just coincidence.

Unfortunately, at present neither camera will work, so I can't further test this.
The issue may also re-emerge shortly after it is fixed.

It may also go away after a while with no explanation.
We left it alone for a weekend and it was gone when we came back.
Then it immediately returned the next time we tried to launch it.

Attempted (failed) fixes:
Output of lsusb and v4l2-ctl --list-devices does not show any discrepancies between the working and not working camera.
Both Astras work fine on the AGX.

Rebuilding libuvc and astra_camera
Rebooting server
Redoing Astra udev rule setup
Replugging Astra in different USB ports on the server

Uninstalling libuvc from source (v0.0.7) and installing with sudo apt install libuvc-dev (v0.0.6-1).
As libuvc does not have a uninstall target, it must be manually uninstalled by deleting files specified in libuvc/build/cmake_install.cmake.
This includes files in /usr/local/ in lib/, include/, lib/cmake/, lib/pkgconfig
This did not resolve the issue.

Changing to different git release tags of the ros_astra_camera package, specifically v1.2.2 and v1.2.1, shows a different error:

[ERROR] [1718397587.594679210]: find uvc device failed, retry 100 times
[ERROR] [1718397588.514027656]: Find device error No such device process will be exit

On a second attempt retrying with version v1.2.1, the uvc device was found, but the original error with libuvc was found.

Attempted reverting to old udev rules as well.
Retrying old rules from v1.2.2 and v1.2.0 had no effect.

Further investigation shows the issue stems from libuvc, which does not have proper support for UVC 1.5.
Further details are documented here:
libuvc/libuvc#189

The fix proposed in the issue does not seem effective.
However, it may still be possible to solve the issue without altering libuvc.

Since the ros_astra_camera previously worked, I can only assume it has not always been using UVC 1.5.
Is it possible to specify which UVC version is used in the ros_astra_camera package?
What could have caused the UVC version to change?

As noted above, rolling back to previous releases does not seem to resolve the issue.

Further investigation shows the issue is caused by a RealSense D435i.
The launch always fails when both devices are plugged into our computer, and succeeds when only the Astra is launched.
The RealSense doesn't even need to be running, just plugging it in seems to be enough to cause issues.

This issue appears localized to this machine, as we have successfully run both cameras together before on a Jetson AGX.

The RealSense D435i is compliant with UVC 1.5.
It seems that there is some issue with the Astra and the D435i in some cases causing uvc issues for the Astra.

This issue is a repeat of Issue #190

Newer versions of UVC camera driver have removed the correction in the code that fixed this issue.
The same fix will resolve the issue.

Closing this issue; while it is not fixed in the current version of code, the fix is known and easy to do.