IntelRealSense / librealsense

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

[D435i connection issue on Jetson Orin Nano] #13553

Open sooyoungmoon opened 1 day ago

sooyoungmoon commented 1 day ago

Required Info
Camera Model { D435i }
Firmware Version 5.14.0
Operating System & Version Jetpack 6.0 LUbuntu 22.04.5 LTS
Kernel Version (Linux Only) 5.15.136-tegra
Platform NVIDIA Jetson Orin Nano
SDK Version (librealsense) 2.55.1
Language C++
Segment Robot

Hi, I am trying to do SLAM using Intel realsense2 D435i camera on my Jetson Orin Nano board. But I'm experiencing connection issue with a D435i camera on my Jetson Orin Nano board.

Description

Issue: D435i Camera is not detected in realsense-viewer on my Jetson Orin Nano board

Progress until now:

0) Built librealsense from source Linux Ubuntu Installation > An error occurred when I tried to execute ./scripts/patch-realsense-ubuntu-lts-hwe.sh

Installed dependencies except for QtCreator (optional)
$ git clone https://github.com/IntelRealSense/librealsense.git
$ ./scripts/setup_udev_rules.sh

Install librealsense2
    1. $ git clone https://github.com/IntelRealSense/librealsense.git 
    2. $ ./scripts/setup_udev_rules.sh  

    3.Build and apply patched kernel modules for Ubuntu 20/22 (focal/jammy) with LTS kernel 5.13, 5.15, 5.19, 6.2, 6.5

        $ ./scripts/patch-realsense-ubuntu-lts-hwe.sh > following error occurred!
        E: Unable to locate package linux-headers-5.15.136-tegra
        E: Couldn't find any package by glob 'linux-headers-5.15.136-tegra'
        E: Couldn't find any package by regex 'linux-headers-5.15.136-tegra'

Building librealsense2 SDK
- ...
$ cmake ../ -DBUILD_EXAMPLES=true
$ sudo make uninstall && make clean && make && sudo make install > no error

1) Executed realsense-viewer > Camera was not detected!

$lsusb => D435i camera has been connected to the board, but not in the usb device list.
$rs-enumerate-devices => 'No device detected' 

2) Followed the steps in LibUVC-backend installation

The same result as in 1) (i.e., camera is not detected in realsense-viewer and not listed in the usb device list) 

3) Tried to follow the build steps explained in [Intel® RealSense™ camera driver for GMSL* interface] (https://github.com/IntelRealSense/realsense_mipi_platform_driver), but got stuck

  I cannot find where the script ./apply_patches.sh exist.

Questions:

Q#1. Do I have to download & build MIPI driver? I'm concerned that If it is mandatory or not.     

Q#2. I don't have a RealSense de-serialize board. Does it mean that I cannot install the MIPI platform driver to my jetson orin nano board?

Q#3 When I tried to execute the script ./scripts/patch-realsense-ubuntu-lts-hwe.sh, the following error occurred. 
  E: Couldn't find any package by glob 'linux-headers-5.15.136-tegra'
  E: Couldn't find any package by regex 'linux-headers-5.15.136-tegra'
      > What should I do to solve this?

Thank you for your support. I'm looking forward to your comment.

MartyG-RealSense commented 1 day ago

Hi @sooyoungmoon When installing from source code on Jetson, the installation_jetson.md instructions at the dedicated Jetson installation page at the link below should be used.

https://github.com/intelRealSense/librealsense/blob/master/doc/installation_jetson.md#building-from-source-using-native-backend

Jetson also has its own dedicated patch script called patch-realsense-ubuntu-L4T.sh that should be used instead of the hwe patch script.

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


You can also build from source using the libuvc backend procedure, which I note that you have aleady tried.


As you are using JetPack 6 with an IMU-equipped D435i camera, the non-detection is likely to be related to JP6 because it no longer has a function called hiddraw that RealSense IMU cameras depended on. As you are using Ubuntu 22.04, resolving the detection problem by downgrading to JetPack 5.1.3 may not be an option for you.


In regard to the approach of adding JP6 support for IMU by installing the MIPI driver, you can seek advice about it at the driver's dedicated support page at the link below.

https://github.com/IntelRealSense/realsense_mipi_platform_driver/issues

Q1: Building the MIPI driver is not mandatory if you can add IMU support by using JP 5.1.3 (for example, by downgrading to Ubuntu 20.04) or using the libuvc baackend installation procedure (which did not solve the problem for you in this particular case). If neither a JP downrade or the libuvc procedur work for you though then the MIPI driver would be the final option available, other than changing to a non-IMU camera model such as D435.

Q2: A deserializer board is not required to use the MIPI driver for the purpose of adding IMU support to a camera being used on a USB cable connection.

Q3: As mentioned above, the L4T patch script should be used with Jetson boards istead of the HWE patch script.


Intel also strongly recommend enabling the barrel jack power connector for Nano type Jetson boards, using the instructions at the link below.

https://jetsonhacks.com/2019/04/10/jetson-nano-use-more-power/

shivani-varsha commented 4 hours ago

I had the same issue with D455 realsense camera connectivity with Jetson with Jetpack 6.0 , Ubuntu 22.04 and ROS2 humble version. Will it be compatible if i downgrade to jetpack 5.1.3 , ubuntu 20.04 and ros1 noetic version, by just starting by cloning the librealsense package?

MartyG-RealSense commented 4 hours ago

@shivani-varsha The stated downgrade configuration should work.

shivani-varsha commented 4 hours ago

@shivani-varsha The stated downgrade configuration should work.

Thanks for verifying.

sooyoungmoon commented 2 hours ago

As far as I understood, I should do one of two options to patch kernel in the installation_jetson.md; 1) Building from source using RSUSB backend or 2) Building from source using Native backend, right? I will try them and share the result. Have a nice weekend!

2024년 11월 28일 (목) 오후 7:17, MartyG-RealSense @.***>님이 작성:

Hi @sooyoungmoon https://github.com/sooyoungmoon When installing from source code on Jetson, the installation_jetson.md instructions at the dedicated Jetson installation page at the link below should be used.

https://github.com/intelRealSense/librealsense/blob/master/doc/installation_jetson.md#building-from-source-using-native-backend

Jetson also has its own dedicated patch script called patch-realsense-ubuntu-L4T.sh that should be used instead of the hwe patch script.

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

You can also build from source using the libuvc backend procedure, which I note that you have aleady tried.

As you are using JetPack 6 with an IMU-equipped D435i camera, the non-detection is likely to be related to JP6 because it no longer has a function called hiddraw that RealSense IMU cameras depended on. As you are using Ubuntu 22.04, resolving the detection problem by downgrading to JetPack 5.1.3 may not be an option for you.

In regard to the approach of adding JP6 support for IMU by installing the MIPI driver, you can seek advice about it at the driver's dedicated support page at the link below.

https://github.com/IntelRealSense/realsense_mipi_platform_driver/issues

Q1: Building the MIPI driver is not mandatory if you can add IMU support by using JP 5.1.3 (for example, by downgrading to Ubuntu 20.04) or using the libuvc baackend installation procedure (which did not solve the problem for you in this particular case). If neither a JP downrade or the libuvc procedur work for you though then the MIPI driver would be the final option available, other than changing to a non-IMU camera model such as D435.

Q2: A deserializer board is not required to use the MIPI driver for the purpose of adding IMU support to a camera being used on a USB cable connection.

Q3: As mentioned above, the L4T patch script should be used with Jetson boards istead of the HWE patch script.

Intel also strongly recommend enabling the barrel jack power connector for Nano type Jetson boards, using the instructions at the link below.

https://jetsonhacks.com/2019/04/10/jetson-nano-use-more-power/

— Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/13553#issuecomment-2505752901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG2RHPBI44KUVVVFYWWQAL2C3UUJAVCNFSM6AAAAABSTM7OFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBVG42TEOJQGE . You are receiving this because you were mentioned.Message ID: @.***>

MartyG-RealSense commented 1 hour ago

Yes they are two installation options, though if you use the RSUSB method then you do not need to use a kernel patch.

If you use method 2 then the Jetson kernel patch script patch-realsense-ubuntu-L4T.sh should be used.

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

I look forward to your next report. Good luck!