Skip to content
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

(d400-factory.cpp) DS5 group_devices is empty #2883

Closed
jesusramondovale opened this issue Sep 27, 2023 · 25 comments
Closed

(d400-factory.cpp) DS5 group_devices is empty #2883

jesusramondovale opened this issue Sep 27, 2023 · 25 comments
Labels

Comments

@jesusramondovale
Copy link

Hi! I'm using a DEBIX Model-A (aarch64 ARMv8) board with Ubuntu-22.04 and kernel 5.15.71 installed on it (with ROS2 Humble)

I've got a problem with my Realsense D435i Camera: I've succesfully compiled from sources the SDK (librealsense) so I can correctly use the rs-enumerate-devices command (only with sudo before)

but, when I execute the ROS2 Wrapper with:
ros2 run realsense2_camera realsense2_camera_node

I get this output:

[INFO] [launch]: All log files can be found below /home/debix/.ros/log/2023-09-27-06-45-57-373454-DEBIX25-14668 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [realsense2_camera_node-1]: process started with pid [14682] [realsense2_camera_node-1] [INFO] [1695797158.404652736] [camera.camera]: RealSense ROS v4.54.1 [realsense2_camera_node-1] [INFO] [1695797158.404968999] [camera.camera]: Built with LibRealSense v2.54.1 [realsense2_camera_node-1] [INFO] [1695797158.405047252] [camera.camera]: Running with LibRealSense v2.54.1 [realsense2_camera_node-1] 27/09 06:45:58,435 WARNING [281472476768480] (d400-factory.cpp:1195) DS5 group_devices is empty. [realsense2_camera_node-1] 27/09 06:45:58,830 ERROR [281472476768480] (librealsense-exception.h:52) xioctl(VIDIOC_S_EXT_CTRLS) failed Last Error: Invalid argument [realsense2_camera_node-1] 27/09 06:45:58,837 WARNING [281472476768480] (rs.cpp:312) null pointer passed for argument "device" [realsense2_camera_node-1] [WARN] [1695797158.837362369] [camera.camera]: Device 1/3 failed with exception: xioctl(VIDIOC_S_EXT_CTRLS) failed Last Error: Invalid argument [ERROR] [realsense2_camera_node-1]: process has died [pid 14682, exit code -11, cmd '/home/debix/ros2_ws/install/realsense2_camera/lib/realsense2_camera/realsense2_camera_node --ros-args --log-level info --ros-args -r __node:=camera -r __ns:=/camera --params-file /tmp/launch_params_j9ko_vrh --params-file /tmp/launch_params_w3fbxgpj'].

NOTE: I tried installing the ROS2-Wrapper (apt-get install) and also compiling it from source but both options gave the same error

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 27, 2023

Hi @jesusramondovale xioctl(VIDIOC_S_EXT_CTRLS) errors typically indicate that there is a conflict between librealsense and the Linux kernel, though I note that your librealsense installation appears to be performing normally.

Kernel version 5.15 should be fine in general, though there is the possibility of problems with specific kernel versions.

Can you confirm whether using ros2 launch also does not work for you, please?

ros2 launch realsense2_camera rs_launch.py

@jesusramondovale
Copy link
Author

jesusramondovale commented Sep 27, 2023

Yes, doing
ros2 launch realsense2_camera rs_launch.py
gives exactly the same output.

And it occurs the same with another parameters, and also the same running it doing sudo su before.

I think the problem is some related to permissions, because if I execute
rs-enumerate-devices it gives also the same output, but executing:
sudo rs-enumerate-devices works perfect:

debix@DEBIX25:$ rs-enumerate-devices
27/09 08:50:08,191 ERROR [281472996930656] (librealsense-exception.h:52) xioctl(VIDIOC_S_EXT_CTRLS) failed Last Error: Invalid argument
Could not create device - xioctl(VIDIOC_S_EXT_CTRLS) failed Last Error: Invalid argument . Check SDK logs for details
Segmentation fault (core dumped)
debix@DEBIX25:$ sudo rs-enumerate-devices
[sudo] password for debix:
Device info:
Name : Intel RealSense D435I
Serial Number : 231122071093
Firmware Version : 5.15.0.2
Recommended Firmware Version : 5.15.0.2
Physical Port : 1-1.3-3
Debug Op Code : 15
Advanced Mode : YES
Product Id : 0B3A
Camera Locked : YES
Usb Type Descriptor : 2.1
Product Line : D400
Asic Serial Number : 221123063041
Firmware Update Id : 221123063041

May it be a problem related to which user (root or debix) installed the librealsense SDK, and which one is executing the ros2 wrapper?

Thank you for answering so quick!

@MartyG-RealSense
Copy link
Collaborator

I agree that it could be a permissions issue.

Does it make a difference if you input sudo su into the terminal before you input the ros2 run launch command?

@jesusramondovale
Copy link
Author

No. It doesn't:

image

@MartyG-RealSense
Copy link
Collaborator

DS5 group_devices is empty suggests to me that the camera is not being detected by the launch.

What happens if the camera is reset at launch by adding initial_reset:=true to the ros2 launch instruction?

ros2 launch realsense2_camera rs_launch.py initial_reset:=true

@jesusramondovale
Copy link
Author

jesusramondovale commented Sep 27, 2023

Nothing changed using that flag: (I set the logs to DEBUG mode)

EDIT: doing sudo su before changes nothing

image
image

@MartyG-RealSense
Copy link
Collaborator

  1. Is there any difference if you reload the udev device handling rules with the instruction below?

sudo udevadm control --reload-rules && udevadm trigger

  1. When you installed librealsense from source code, was the build flag -DFORCE_RSUSB_BACKEND=TRUE included in the build instruction? An RSUSB build of the SDK can bypass problems caused by kernel conflicts.

@jesusramondovale
Copy link
Author

jesusramondovale commented Sep 27, 2023

  1. There's no difference.

  2. Builded it using -DFORCE_RSUSB_BACKEND=ON :

cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_TM2=false -DIMPORT_DEPTH_CAM_FW=false -DCMAKE_EXE_LINKER_FLAGS="-latomic"

@MartyG-RealSense
Copy link
Collaborator

If you built with -DFORCE_RSUSB_BACKEND=ON then there is not likely to be a conflict with the Linux kernel, as RSUSB bypasses the kernel.

Using sudo superuser mode with the ROS wrapper does not help. So it may not be a permissions related issue after all, especially as librealsense works normally in sudo mode.

  1. Is the camera detected if, after a failed launch, you unplug the camera, re-insert it and then run the launch instruction again a second time?

  2. Does specifying the camera device type help?

ros2 launch realsense2_camera rs_launch.py device_type:=d435

@jesusramondovale
Copy link
Author

jesusramondovale commented Sep 27, 2023

But it is -DFORCE_RSUSB_BACKEND=ON or -DFORCE_RSUSB_BACKEND=true? I used ON

  1. I executed the ros2 launch (error output), unplugged and reinserted the camera, launched again and nothing changed. Same error output.
  2. No. Same output with

ros2 launch realsense2_camera rs_launch.py device_type:=d435

One question: which kernel modules are needed to librealsense to work well?

@MartyG-RealSense
Copy link
Collaborator

Either ON or TRUE should work.

If RSUSB = true then the kernel is bypassed, so it should not matter which kernel the computer is using.

At the time of writing this, librealsense officially supports kernel versions 4, 4.8, 4.10, 4.13, 4.15, 4.18, 5.0, 5.3, 5.4, 5.13 and 5.15.

@jesusramondovale
Copy link
Author

No, I meant the names of the kernel "packages" like uvcvideo... etc. Which ones it uses?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 27, 2023

The core packages required to build librealsense from source code are:

libssl-dev
libusb-1.0-0-dev
libudev-dev
pkg-config
libgtk-3-dev

The packages referenced as requirements in the 5.15 kernel patch script are:

libssl-dev
libusb-1.0-0-dev

https://github.com/IntelRealSense/librealsense/blob/master/scripts/patch-realsense-ubuntu-lts-hwe.sh

When using RSUSB = true though, a source code build of librealsense does not need to have a kernel patch script applied.

@jesusramondovale
Copy link
Author

jesusramondovale commented Sep 28, 2023

Hi again! I reinstalled the SDK compiling from source with -DFORCE_RSUSB_BACKEND=true, the rs-enumerate-devices works (only with sudo)

The ROS2 wrapper (installed via apt-get install) doesn't work. Same output.

I've got all packages you mentioned installed to the last version

What can I try now? Is it normal that the output is the same if the camera is plugged or unplugged?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 28, 2023

You could try deleting the entire /ros2_ws/src catkin workspace folder to remove the source code installation of the wrapper and then build the wrapper from source again.

I would recommend removing the realsense2_camera package first though as it is not advisable to have both package and source code installations of the wrapper or of librealsense on the same computer.

If you do not mind reinstalling librealsense before installing the wrapper again then a quick way to remove the package would be to remove all RealSense-related packages from the computer with the instruction below.

dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge

@jesusramondovale
Copy link
Author

I don't know if I'm getting crazy or what. I don't believe what has just happened:
I executed:
dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge

And next I tried to run (to be sure that it is now removed)
ros2 run realsense2_camera realsense

and INCREDIBLY now it works!!!! Both ros2 run and ros2 launch works

@MartyG-RealSense
Copy link
Collaborator

That's great to hear. When everything else has not worked, sometimes you can get lucky with an uninstall without ever knowing what the cause of the problem was.

@MartyG-RealSense
Copy link
Collaborator

Hi @jesusramondovale Do you require further assistance with this case, please? Thanks!

@jesusramondovale
Copy link
Author

After a couple of days using the camera, the exact same error appeared again

@MartyG-RealSense
Copy link
Collaborator

Sincere apologies for the delay in responding further. Has the error continued, please?

@jesusramondovale
Copy link
Author

It's very strange because it started working again with no reason, I can't give you good feedback

@MartyG-RealSense
Copy link
Collaborator

Okay, please do let me know if it stops working again. I will keep this case open in the meantime.

@MartyG-RealSense
Copy link
Collaborator

Hi @jesusramondovale is ROS still working correctly for you after a 2 week period since your last comment, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Hi @jesusramondovale Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants