-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Multiple RS (D435) cameras couldn't work consistently every time when launched by roslaunch #1734
Comments
BTW, I also got the random issue, with the latest
|
Hi @Austin-Hu I note that you are using kernel 5.9. The librealsense SDK is currently only validated to use Ubuntu kernels up to 5.4. So there may be unpredictable consequences from using an officially unsupported newer kernel such as 5.9. An alternative approach to ROS multicam that you could try in order to test whether it produces improved reliability for you is to launch each camera from a separate terminal using roslaunch realsense2_camera rs_camera.launch camera:=cam_1 serial_no:=$SN_1 for the first camera and roslaunch realsense2_camera rs_camera.launch camera:=cam_2 serial_no:=$SN_2 for the second camera in the other terminal. https://github.com/IntelRealSense/realsense-ros/wiki/Showcase-of-using-2-cameras You could also try adding the command initial_reset:=true to the end of the cam1 and cam2 roslaunch statements to perform a reset of the camera at launch to see if that helps with the Failed to set power state error. |
Thanks for your quick reply! The reason I'm using Linux kernel v5.9.0, because its i915 driver started to support Tiger Lake (with Intel Gen12 GPU) since v5.8.0. As you suggested, launching the 2 cameras separately (sequentially) works for me, with several rounds of termination and relaunching. But we'd not prefer this workaround for our application based on Adding the
or:
with the error log:
BTW, from the Linux kernel support list of librealsense, shall I submit this issue to librealsense community? Thanks! |
Submitting a request for support of newer kernels would likely not accelerate the implementation schedule. The librealsense SDK can be built from source code in RSUSB backend mode to bypass dependence on kernel versions and Linux versions and also avoid the need for patching, though this type of build is suited to single-camera applications. As the 400 Series cameras can work with any Intel or Arm processor, the Tiger Lake processor is unlikely to be a factor in the problem that you are experiencing with Failed to set power state. Would it be practical to use usb_port_id in the roslaunch instruction to access a particular USB port that a camera is attached to instead of accessing the camera by its serial number? Or does the camera need to work no matter which USB port it is inserted into because it cannot be known in advance which port will be used, in which case the serial number would be the correct approach? https://github.com/IntelRealSense/realsense-ros#launch-parameters |
Is a race in the Note that we've been observing the following kernel error (as reported by
|
@MartyG-RealSense, thanks for your suggestion! But using
The 2 RS cameras could always work successfully after rebooting system, but one of them would randomly have the I'm looking at the context of Issue #1187 where you talked about the same problem. |
Once the random
BTW, as @ngaloppo mentioned above, I also got such dmesg error during reproducing the issue:
|
The issue seems to me not to be a ROS issue but a librealsense2 issue. |
@doronhi, thanks for forwarding the context of #1346, and I agree with your comment:
As for your suggestion that "it's best to use the build that uses the v4l backend", were you mentioning the steps of "Use the V4L Native backend by applying the kernel patching" here (althoug I'm not using Jetson)? Thanks! |
@doronhi reading from librealsense installation readme.md they explained that
It looks like librealsense in Linux is already using V4L2 backend. Although realsense-ros readme.md states otherwise,
Is there a difference between the 2 librealsense2 SDK that are mentioned in these readme.md? |
Hi @leopck It is the same SDK in both cases but it will have different behaviors depending on which build method was used. RSUSB backend (a build method previously known as libuvc backend) has the advantage when set to True of installing librealsense over an internet connection without dependence on Linux versions or kernel versions and without the need for patching. This can be useful in situations where some element of the RealSense user's Linux configuration such as the kernel version conflicts with librealsense. It does have some limitations though and is not recommended for use in commercial projects. For more information about this, please visit the link below and scroll down through the linked-to comment to the section headed What are the advantages and disadvantages of using libuvc vs patched kernel modules? IntelRealSense/librealsense#5212 (comment) V4L2 backend can be considered to be a build mode where libuvc backend (installation without kernel patching) is set to False. |
@MartyG-RealSense @doronhi thank you very much for your V4L2 backend explanation and suggestion. I've tested by recompiling the librealsense with v4l2 backend and it's now running without crashing 10/10 times of me running dual camera setup. @ngaloppo @Austin-Hu this solution works for me, if you don't see the dual camera setup crashing issue anymore then it's great.
|
Excellent news @leopck - thanks very much for the information about your success! |
@MartyG-RealSense, @doronhi, @leopck, @ngaloppo, appreciate for your comments and suggestions! Turning off @MartyG-RealSense, please help forward such information (or workaround) of applying the V4L backend (for Linux only) to other issues with similar problem. Thanks again, and close this issue. |
Great news @Austin-Hu that -DFORCE_LIBUVC=OFF solved your multiple camera problem with Failed to set power state. I have added notes to my research records so that they come up when researching future cases similar to this one. Thanks! |
Hardware Configuration:
Software Configuration:
How to reproduce:
roslaunch realsense2_camera rs_multiple_devices.launch serial_no_camera1:=$SN_1 serial_no_camera2:=$SN_2
;Ctrl + C
to terminate;Tthe random issue happens with the log:
The text was updated successfully, but these errors were encountered: