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

pyrealsense2 no device found #12894

Open
szymonzmyslony opened this issue May 3, 2024 · 19 comments
Open

pyrealsense2 no device found #12894

szymonzmyslony opened this issue May 3, 2024 · 19 comments

Comments

@szymonzmyslony
Copy link

Required Info
Camera Model D435i
Firmware Version 5.15.0.2
Operating System & Version Ubuntu 22
Kernel Version (Linux Only) 5.15.122
Platform NVIDIA Jetson Orin Nano
Librealsense SDK Version 2.54.1
Language python
ROS Distro Humble
RealSense ROS Wrapper Version 4.54.1

Issue

I installed the realsense library from source with -DFORCE_RSUSB_BACKEND=ON -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DBUILD_WITH_CUDA:bool=true and completed all instructions based on this comment. Realsense GUI and cmd tools work perfectly but the python wrapper doesn't detect (or work at all) on my Jetson device

Crossposting from ros-repo, closing old issue

@MartyG-RealSense
Copy link
Collaborator

Hi @szymonzmyslony The Jetson source code installation guide at #6964 (comment) recommends adding definitions for the PYTHONPATH to the end of the bashrc file after initiating the sudo make install command and then sourcing the file.

@szymonzmyslony
Copy link
Author

the binaries for Python wrapper do not exists anywhere (I also don't get any errors / warnings associated with it during build time), is there a way to find a workaround here ?

@MartyG-RealSense
Copy link
Collaborator

Instead of building the Python wrapper at the same time as the librealsense SDK, you can build librealsense first without the wrapper and then install the wrapper separately from a .whl package with the command pip install pyrealsense2

Whilst pip install supports installation on Arm devices with an aarch64 wheel file, Jetson users have often found that a pip install does not work for them. You are welcome to try it on your own Jetson, of course. A Jetson user at #12362 (comment) apparently did manage to make it work.

@furiousteabag
Copy link

We have tried it previously, we end up with an error:

    pipeline_profile = config.resolve(pipeline_wrapper)
RuntimeError: No device connected

@furiousteabag
Copy link

furiousteabag commented May 3, 2024

We tried to use python3.9 with python3.9 -m pip install pyrealsense2==2.54.1.5217 and getting the same No device connected problem, while at the same time realsense-viewer and ros wrapper work

@MartyG-RealSense
Copy link
Collaborator

One of my Intel RealSense colleagues advised that if there is not a suitable official pyrealsense2 pip installation package file available then you can build the pyrealsense2 wrapper from source code and then upload it as your own Python package. The link below has a guide for creating and uploading packages to PyPi.

https://www.turing.com/kb/how-to-create-pypi-packages

@furiousteabag
Copy link

We have suitable pyrealsense2 pip installation python3.9 -m pip install pyrealsense2==2.54.1.5217, but it just doesn't work:

    pipeline_profile = config.resolve(pipeline_wrapper)
RuntimeError: No device connected

@MartyG-RealSense
Copy link
Collaborator

A RealSense Jetson user at #12807 (comment) who recently experienced RuntimeError: No device connected managed to get the pyrealsense2 wrapper working by using JetPack 5.1.3 and Python 3.8 after initially having the error with JetPack 6.

@furiousteabag
Copy link

I see, but downgrading JetPack is not an option, because many other libraries and programs depend on it. What can I try to do to make it work on JetPack 6.0?

@MartyG-RealSense
Copy link
Collaborator

The latest 2.55.1 version of the librealsense SDK supports JetPack 6. The RealSense user at #12807 had RuntimeError: No device connected with JetPack 6 and the pyrealsense2 wrapper, though at that time they were using librealsense 2.54.2 because the Jetpack 6 supporting 2.55.1 had not been released yet. So it may be worth trying 2.55.1 with JetPack 6.

@MartyG-RealSense
Copy link
Collaborator

HI @furiousteabag Do you require further assistance with this case, please? Thanks!

@furiousteabag
Copy link

Hey Marty! Tomorrow we will be trying to install 2.55.1 with Jetpack 6 and pyrealsense2. Will keep you posted here!

@MartyG-RealSense
Copy link
Collaborator

Thanks very much @furiousteabag for the update - good luck!

@thomasaab
Copy link

Hello, I am having exactly the same problem. Were you able to solve it? I have version 2.55.1 installed, with Jetpack 6, the same camera with firmware 5.16.0.1. The command "rs-enumerate-devices" recognizes the device, but pyrealsense2 does not. I have already tried different solutions that I have found, but I really don't want to downgrade to Jetpack 5.

Any help would be greatly appreciated!

@furiousteabag
Copy link

@thomasaab We haven't tried yet with 2.55.1, but keep us posted if you will have some progress!

@shankar-anantak
Copy link

shankar-anantak commented May 16, 2024

Hello, I am using Orin dev kit with Jetpack 6.

Ive been trying to build 2.55.1 with python bindings but have been unsuccessful:

Traceback (most recent call last):
  File "/home/ubuntu/dev/Pipelines/hawkeye/empties_grid/empties_grid.py", line 81, in <module>
    pipeline.start(config)
RuntimeError: No device connected

I've tried almost every solution referenced. Any assistance is appreciated

@MartyG-RealSense
Copy link
Collaborator

Hi @shankar-anantak A RealSense user at #12807 who had RuntimeError: No device connected with JetPack 6 downgraded to JetPack 5.1.3. Are you able to downgrade your JetPack or is this not an option in your particular situation, please?

@shankar-anantak
Copy link

shankar-anantak commented May 17, 2024

Hi @shankar-anantak A RealSense user at #12807 who had RuntimeError: No device connected with JetPack 6 downgraded to JetPack 5.1.3. Are you able to downgrade your JetPack or is this not an option in your particular situation, please?

Hi @MartyG-RealSense, unfortunately downgrading is not an option at the moment as JP6 contains updated versions for some of the other frameworks I need.

Again, any assistance you can provide is appreciated!

For Context:

Jetson Orin dev kit, Ubuntu 22.04, JP6, Python3.10, Cuda 12

I have tried both LIBUVC, RSUSB methods w and w/ out a kernel patch script, building latest librealsesnse from source, update cmake method, copying the .so files to various locations throughout the system and adding to path, etc

@MartyG-RealSense
Copy link
Collaborator

Hi @shankar-anantak Have you tried the JetsonHacks website's buildLibrealsense.sh librealsense source-code build script for Jetson boards? The script includes the -DBUILD_PYTHON_BINDINGS=bool:true build flag for installing the pyrealsense2 wrapper at the same time as compiling librealsense.

https://github.com/jetsonhacks/installRealSenseSDK/tree/master?tab=readme-ov-file#buildlibrealsensesh

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

No branches or pull requests

5 participants