IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.59k stars 4.82k forks source link

Realsense-viewer does not register camera unlesss I use a docker container #13417

Open AnayGokhale opened 1 week ago

AnayGokhale commented 1 week ago
Required Info
Camera Model D435i
Firmware Version 5.16.0.1
Operating System & Version Ubuntu 22
Kernel Version (Linux Only) 5.15.136-tegra
Platform NVIDIA Jetson Orin Nano 8gb Developer Kit
SDK Version 2.0 I think I am not sure how to check
Language python

Issue Description

I have been able to run realsense-viewer through a docker container following these links:https://nvidia-isaac-ros.github.io/getting_started/dev_env_setup.html and https://nvidia-isaac-ros.github.io/getting_started/hardware_setup/sensors/realsense_setup.html However, When I try to run it normally, realsense-viewer does not register the camera. Similarly I tried the python script in the image below, and I got Runtime Error: No device connected. Please help me fix this. Screenshot from 2024-10-13 17-08-36

MartyG-RealSense commented 1 week ago

Hi @AnayGokhale Is the camera detected outside of Docker if you launch the programs with sudo admin permissions, please? For example:

sudo realsense-viewer

sudo python3 test.py

In regard to checking your SDK version, if you look at the version number at the top of the realsense-viewer window then that will also be the SDK version number.

AnayGokhale commented 1 week ago

@MartyG-RealSense The camera is not detected outside the Docker even if I run it with sudo permissions. The SDK version is v2.55.1

MartyG-RealSense commented 1 week ago

What procedure did you use to install librealsense outside of a Docker container, please? For example, installing from packages using the Jetson instructions at the link below.

https://github.com/intelRealSense/librealsense/blob/master/doc/installation_jetson.md#4-install-with-debian-packages

AnayGokhale commented 1 week ago

@MartyG-RealSense Hello, I followed the steps from that exact link. It does not work still. I did not do anything besides the instructions in that link.

AnayGokhale commented 1 week ago

@MartyG-RealSense This is the output when I run realsense-viewer:

15/10 18:43:46,825 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video0 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video0 15/10 18:43:46,944 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video1 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video1 15/10 18:43:46,945 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video2 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video2 15/10 18:43:46,946 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video3 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video3 15/10 18:43:46,947 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video4 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.3/video4linux/video4 15/10 18:43:46,948 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video5 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.3/video4linux/video5 15/10 18:43:47,449 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video0 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video0 15/10 18:43:47,450 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video1 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video1 15/10 18:43:47,451 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video2 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video2 15/10 18:43:47,451 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video3 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.0/video4linux/video3 15/10 18:43:47,452 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video4 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.3/video4linux/video4 15/10 18:43:47,452 INFO [281473468672064] (backend-v4l2.cpp:753) Enumerating UVC video5 realpath=/sys/devices/platform/bus@0/3610000.usb/usb1/1-1/1-1:1.3/video4linux/video5 15/10 18:43:47,460 INFO [281473468672064] (context.cpp:128) Found 0 RealSense devices (0xff requested & 0xff from device-mask in settings)

MartyG-RealSense commented 1 week ago

As you are using Ubuntu 22 and a Jetson, are you using JetPack 6 please? JP6 can cause RealSense cameras equipped with an IMU like D435i (known as HID devices) to not be detected, as JP6 lacks a function called 'hiddraw' that the IMU-equipped RealSense cameras rely upon.

There are some librealsense installation methods that can workaround the IMU issue though to enable the camera to work. These are:

  1. Install the RealSense MIPI driver at the link below, which adds support for IMU when using JetPack 6. I do not recommend this method if possible to avoid it though due to the complexity of the installation procedure.

https://github.com/IntelRealSense/realsense_mipi_platform_driver

Or:

  1. Build librealsense from source code with the 'libuvc backend' installation method, which has a build script called 'libuvc_installation.sh'

https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md

https://github.com/IntelRealSense/librealsense/blob/master/scripts/libuvc_installation.sh

A libuvc build of librealsense bypasses the kernel and so is not dependent on a particular Linux version or kernel version and does not need to have a kernel patch applied to it.

Or:

  1. Downgrade your JetPack version from 6 to 5.1.3, though this is not an option for many RealSense Jetson users.
AnayGokhale commented 6 days ago

Hello, I am using JetPack 6. I tried method number 2 however it still does not work. rs-enumerate-devices returned No device detected. Is it plugged in? and the realsense-viewer UI did not register it either. I have also tried connecting it to the Jetson Orin Nano through the USB-A port and it still does not work. I cannot do method number 3 as it Jetpack 5.1.3 is not useful to me. Is there any other solution?

MartyG-RealSense commented 5 days ago

Other than building librealsense beta version 2.56.2 from source code (as official JetPack 6 support was added in version 2.56.1), I cannot think of another method to try unfortunately.

https://github.com/IntelRealSense/librealsense/releases/tag/v2.56.2

Would you be able to continue using librealsense from with a Docker container if a solution is not achieved for outside-container use?