-
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
Error installing Intel RealSense SDK for D405 camera on Jetson Nano with ROS2 #2661
Comments
Hi @kevinDrawn The problem in this case may be with Ubuntu rather than librealsense or the ROS wrapper. Installing librealsense from packages on Arm64 devices such as Jetson is supported on Ubuntu 18.04 but not on 20.04. There are no plans to add Arm64 packages for 20.04 in future and so librealsense should instead be built from source code on Ubuntu 20.04. The correct order of installation is to install librealsense first and then build the ROS wrapper from source code secondly afterwards. An instruction guide for installing librealsense on Jetson from source code can be found at IntelRealSense/librealsense#6964 (comment) |
Thank you so much for the answer! I just want to confirm the process step by step, can you check if the order I understand is correct?
If I understand the process correctly, I will let you know after I have completed it. |
A RealSense user disclosed at #2582 (comment) that the ROS1 wrapper can be edited to add D405 support. You could likely implement this edit by creating a custom 'forked' D405-supporting version of the ROS1 wrapper on your own GitHub account that can be built from the source code instead of the official ROS1 wrapper, similar to how the leggedrobotics wrapper page that you linked to is a fork of the official wrapper.
Instead of using ROS1, it may be easier to install ROS2 Dashing and use that with Ubuntu 18.04, librealsense 2.53.1 and the ros2-development wrapper that is compatible with D405. |
Thank you! I solved my problem! But i have another question.
<buildtool_depend>catkin</buildtool_depend>
|
In a small number of cases, 'import pyrealsense2 as rs' may need to be changed to import pyrealsense2.pyrealsense2 as rs in order for a script to work. Also, CMake 3.8 instead of 3.0.2 is the recommended minimum for librealsense. |
Even after trying the first method and updating CMake, it still doesn't work. Do I need to make additional modifications to the package.xml or CMake files? |
Traceback (most recent call last): I got this error message, |
Have you installed the RealSense Python wrapper pyrealsense2 please? The pyrealsense2 wrapper is not included in the ROS wrapper, so a Python script that uses import pyrealsense2 as rs would not be able to find pyrealsense2 on the computer in order to enable that instruction to work. The pyrealsense2 wrapper can be built at the same time as the librealsense SDK if the instructions at IntelRealSense/librealsense#6964 (comment) are used to build librealsense on Jetson from source code. If you used those instructions and successfully installed the pyrealsense2 wrapper, which Python 3 version are you using? The instruction guide uses Python 3.6. If you have a version of Python newer than 3.6 installed then you should update the version number in the installation commands. For example, for Python 3.9: -DPYTHON_EXECUTABLE=/usr/bin/python3.9 export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.9/pyrealsense2 If you are using Anaconda instead of Python 3 then the path may be different to when Python 3 is used. The command which python3 can tell you what the correct path is. |
I had an issue when dealing with package restructuring between Python 2 and Python 3, specifically when executing the "9. Deal with package restructuring between Python 2 and Python 3 using this method" step. The error message "rs.path" was not found, so I had to manually find the location of "pyrealsense" and run the "cp" command. I ran the following command: After that, the rest of the process was completed without any issues, and I was able to write a regular Python script (without ROS communication) that imported "pyrealsense2" and ran the code without any problems. (It is suspected that) the Python interpreter at the top of the ROS node is looking for Python 2 by default to use packages required for ROS Melodic. This may cause it to fail to find pyrealsense installed in Python 3. `#!/usr/bin/env python import rospy
if name == 'main': |
No. I can't solve this problem... Do you know how to import different versions of python packages on a single node? |
The documentation for the pyrealsense2 wrapper at the link below states that when building the wrapper from source code with CMake, you can force compilation for a specific Python version on a system with both Python 2 and Python 3 installed by using the CMake build flag -DPYTHON_EXECUTABLE=[full path to the exact python executable] lf it is possible to install for both Python 2 and 3, I would think that an approach for doing so would be to install librealsense without the pyrealsense2 wrapper, and then once librealsense is installed, build the pyrealsense2 wrapper on its own from source code with CMake twice, using different -DPYTHON_EXECUTABLE paths for Python 2 and 3 on each install. Doing so should in theory compile separate versions of pyrealsense2.so. The Python 2 version would simply be called pyrealsense2.so and the Python 3 one will have a longer filename based on the version of Python 3 on your computer, such as An alternative approach to using DPYTHON_EXECUTABLE would be to build the pyrealsense2.so files for Python 2 and 3 and then place the .so file for Python 2 or 3 in the project folder beside your pyrealsense2 project script, and also place librealsense2.so in the folder too. You could perhaps have two separate project folders for Python 2 and 3, with the appropriate pyrealsense2.so file placed in each. |
Thank you so much for the explanation! I will try it again today. But if I get stuck again, I want to try writing the code in C++. Since Librealsense is based on C++, it should be easier. |
If you are writing a librealsense program that does not involve ROS then C++ can be easier, and you do not have to deal with the complications involved in installing the pyrealsense2 wrapper. If you are using ROS and creating a librealsense node script that will be launched from ROS then Python will typically be easier than C++. |
Oh!! I solve this problem with python!! A lot of thank!! Have a good day!! |
You are very welcome. It's great to hear that you were successful. Thanks very much for the update! |
Case closed due to solution achieved and no further comments received. |
The Jetson Nano version is 20.04.06 LTS with the code name 'focal'. The ROS version is 'foxy', and when I entered the code to check the Jetpack version, it showed '#R 32, Revision: 3.1'.
The SDK installation method for Jetson Nano was only specified for Ubuntu 18.04 or earlier versions. However, the recently released D405 camera doesn't support ROS1, so I upgraded to ROS2 version. I followed the instructions on https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md to download the SDK, but I encountered the following error:
'sudo apt-get install librealsense2-utils --> E: Unable to locate package librealsense2-utils'.
How can I install the SDK for the D405 version and move on to the next step?
The text was updated successfully, but these errors were encountered: