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

Issues with RealSense D455 on Jetson Orin NX 16GB with ROS2 Humble and JetPack 6.0 #13456

Open
denysderihlazov opened this issue Oct 23, 2024 · 15 comments

Comments

@denysderihlazov
Copy link

Required Info
Camera Model D455
Firmware Version 5.16.0.1
Operating System & Version Ubuntu 22.04.4 with JetPack 6.0 rev 2
Kernel Version (Linux Only) 5.15.136-tegra
Platform NVIDIA Jetson Orin NX 16GB
SDK Version ROS2 Humble
Language C++, Python }
Segment Robotics

Issue Description:

Hello everyone,

I am experiencing issues with the Intel RealSense D455 camera on my Jetson Orin NX 16GB running Ubuntu 22.04.4 with JetPack 6.0 rev 2.

System details:

Jetson Orin NX 16GB with original power supply, running in performance mode.
Intel RealSense D455 with firmware version 5.16.0.1.
Running ROS2 Humble.
RealSense camera works perfectly on a Windows 11 laptop.
Using the original cable from the D455 box.

What works:

The camera is detected using lsusb:

Bus 002 Device 007: ID 8086:0b5c Intel Corp. Intel(R) RealSense(TM) Depth Camera 455

The camera works fine when using the realsense-viewer utility.

Problem:

When I try to use the camera through ROS2 or other tools (e.g., rs-fw-update), it fails to detect the camera properly. The following message appears when I check the system logs:

bash

sudo dmesg | grep realsense
[ 145.379196] usb 2-1.4: Process 7642 (realsense-viewe) called USBDEVFS_CLEAR_HALT for active endpoint 0x84
[ 145.531881] usb 2-1.4: Process 7571 (realsense-viewe) called USBDEVFS_CLEAR_HALT for active endpoint 0x82

Steps Taken:

Installed librealsense using:

bash


git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build && cd build
cmake .. -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA=true
make -j4
sudo make install

Checked all USB permissions (using sudo chmod a+rw /dev/video*), and added the user to the video group.

The camera shows up in lsusb and v4l2-ctl --list-devices, but tools like rs-fw-update cannot detect it:

bash

rs-fw-update -l
There are no connected devices
Tested with JetPack 6.0 rev 2 and JetPack 6.1, but the same issue persists.

Request:

Could anyone help me resolve this issue, or point me to the right direction on how to make the D455 work with ROS2 on Jetson Orin NX? It seems like the camera works only in realsense-viewer, but does not interact with ROS or rs-fw-update.

Thanks in advance!

@denysderihlazov
Copy link
Author

denysderihlazov commented Oct 23, 2024

My goal is to set up RTAB-Map or SLAM as shown in the screenshot:
obraz

Here’s the corrected version of your message:

My goal is to set up RTAB-Map or SLAM as shown in the screenshot:

obraz

I've noticed that the realsense-viewer stops working as soon as I install the realsense-ros2 packages. After installing the ROS2 RealSense drivers, my Intel RealSense D455 camera is no longer visible in the realsense-viewer, although it is still detected by lsusb. However, if I uninstall everything related to the rs-ros2 packages using the following command:

sudo apt remove ros-humble-realsense2-camera ros-humble-realsense2-camera-msgs

the camera starts working again in realsense-viewer. I've been struggling with this issue for more than a month, and I really need to make the camera visible in Rviz in order to set up SLAM/RTAB-Map together with my lidar.

When I try to run the camera via realsense-viewer, I see these error messages (on my Windows 11 laptop, the camera works perfectly):
image_2024-10-23_13-42-38

@MartyG-RealSense
Copy link
Collaborator

Hi @denysderihlazov Have you tried building the ROS2 wrapper from source code instead of from packages to see if the problem still occurs, please?

Install from source

  1. Create a ROS2 workspace
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src/
  1. Clone the latest ROS2 Intel® RealSense™ wrapper from https://github.com/IntelRealSense/realsense-ros.git into ~/ros2_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-master
cd ~/ros2_ws
  1. Install dependencies
sudo apt-get install python3-rosdep -y
sudo rosdep init # "sudo rosdep init --include-eol-distros" for Foxy and earlier
rosdep update # "sudo rosdep update --include-eol-distros" for Foxy and earlier
rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y
  1. Build

colcon build

  1. Source environment
ROS_DISTRO=<YOUR_SYSTEM_ROS_DISTRO>  # set your ROS_DISTRO: iron, humble, foxy
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ros2_ws
. install/local_setup.bash

@denysderihlazov
Copy link
Author

denysderihlazov commented Oct 25, 2024

image
As you can see on a screenshot, I've done it as you mentioned,

Here is my attempt to open realsense-viewer
image
As you can see it is not working

The same when I try to use ROS2 command. I've found a way to open it via ROS2:

Step 1: Clone the Repository

Navigate to your workspace directory and clone the RealSense repository:

bash:

cd ~/ros2_ws
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense

Step 2: Build with RSUSB and CUDA Support

Create a build directory, configure CMake with RSUSB and CUDA enabled, and compile the SDK:

bash:

mkdir build && cd build
cmake ../ -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA=ON -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install

Step 3: Install udev Rules for RealSense

Copy the necessary udev rules for device permissions and reload them:

bash:

sudo cp ../config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

Step 4: Verify the Installation

Run the RealSense Viewer to check if the camera is detected:

bash:
realsense-viewer

Once the camera is detected correctly, you can proceed with installing the ROS2 driver for RealSense.
This is how it works via realsense-viewer:
image
image

And it also works via Rviz:
image
image
I've added everything via Add->By topic -> Image
image

but as you can see with some issues, I can't see cloudpoints2 on Rviz and also depth camera (IR sensor is working and I can see it on a D455 module)

P.S. red dots on Rviz it is Lidar, but nothing related to the Intel Realsense D455 camera.

@MartyG-RealSense
Copy link
Collaborator

Thanks so much @denysderihlazov for your detailed feedback and instructions of what worked for you!

Does it make a difference if you add initial_reset:=true to your ros2 launch instruction to reset the camera at launch?

Is depth able to publish in RViz if you do not enable the pointcloud filter in the launch?

Have you closed down realsense-viewer before performing the ROS launch, as the RealSense ROS wrapper does not require realsense-viewer to be running.

@2805651606
Copy link

My goal is to set up RTAB-Map or SLAM as shown in the screenshot: obraz

Here’s the corrected version of your message:

My goal is to set up RTAB-Map or SLAM as shown in the screenshot:

obraz

I've noticed that the realsense-viewer stops working as soon as I install the realsense-ros2 packages. After installing the ROS2 RealSense drivers, my Intel RealSense D455 camera is no longer visible in the realsense-viewer, although it is still detected by lsusb. However, if I uninstall everything related to the rs-ros2 packages using the following command:

sudo apt remove ros-humble-realsense2-camera ros-humble-realsense2-camera-msgs

the camera starts working again in realsense-viewer. I've been struggling with this issue for more than a month, and I really need to make the camera visible in Rviz in order to set up SLAM/RTAB-Map together with my lidar.

When I try to run the camera via realsense-viewer, I see these error messages (on my Windows 11 laptop, the camera works perfectly): image_2024-10-23_13-42-38

你好,请问你是如何正常使用rtab-map的,我在安装rtab-map ros2版本时:
git clone https://github.com/introlab/rtabmap.git src/rtabmap
git clone --branch ros2 https://github.com/introlab/rtabmap_ros.git src/rtabmap_ros
rosdep update && rosdep install --from-paths src --ignore-src -r -y
export MAKEFLAGS="-j6" # Can be ignored if you have a lot of RAM (>16GB)
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

执行到rosdep update && rosdep install --from-paths src --ignore-src -r -y之后,发现在使用realsense-viewer就再也打不开相机了

orin@ubuntu:~/ros2_rt$ realsense-viewer
26/10 12:29:06,526 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video0 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video0
26/10 12:29:06,732 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video1 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video1
26/10 12:29:06,733 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video2 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video2
26/10 12:29:06,734 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video3 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video3
26/10 12:29:06,735 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video4 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.3/video4linux/video4
26/10 12:29:06,737 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video5 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.3/video4linux/video5
26/10 12:29:07,106 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video0 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video0
26/10 12:29:07,108 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video1 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video1
26/10 12:29:07,108 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video2 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video2
26/10 12:29:07,110 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video3 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/video4linux/video3
26/10 12:29:07,110 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video4 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.3/video4linux/video4
26/10 12:29:07,111 INFO [281472984776736] (backend-v4l2.cpp:753) Enumerating UVC video5 realpath=/sys/devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.3/video4linux/video5
26/10 12:29:07,119 INFO [281472984776736] (context.cpp:128) Found 0 RealSense devices (0xff requested & 0xff from device-mask in settings)
你好,请问你是如何解决的

@MartyG-RealSense
Copy link
Collaborator

Hello @2805651606 Your question has been replied to at #13467 (comment) - thank you!


您好@2805651606 您的问题已在 #13467 (comment) 回复 - 谢谢!

@MartyG-RealSense
Copy link
Collaborator

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

@denysderihlazov
Copy link
Author

denysderihlazov commented Nov 6, 2024

Thanks so much @denysderihlazov for your detailed feedback and instructions of what worked for you!

Does it make a difference if you add initial_reset:=true to your ros2 launch instruction to reset the camera at launch?

Is depth able to publish in RViz if you do not enable the pointcloud filter in the launch?

Have you closed down realsense-viewer before performing the ROS launch, as the RealSense ROS wrapper does not require realsense-viewer to be running.

image

Hi, thank you for your response. I’ll check it as soon as I resolve this issue. My camera is definitely connected, and there is enough power; the 25W mode (the most powerful one) is enabled. This situation is quite strange to me. Maybe I need to install some additional drivers.

Also, I am experiencing the same issue when I try to run it via realsense-viewer.

Okay, I found my old commands to start the camera. There are still some issues, but I can see the RGB and Depth cameras (though not pointclouds2). Thanks to these commands, I can run the camera after a reboot, which wasn’t possible before I discovered them.

Here are the commands:

sudo modprobe -r uvcvideo
sudo modprobe uvcvideo
 export RS2_USB_BACKEND=ON
 sudo cp ~/ros2_ws/librealsense/config/99-realsense-libusb.rules /etc/udev/rules.d/
 sudo udevadm control --reload-rules && sudo udevadm trigger
 sudo systemctl enable realsense_uvcvideo_reload.service

 export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
 export RMW_FASTRTPS_USE_SHM=0

 echo 'export RMW_IMPLEMENTATION=rmw_fastrtps_cpp' >> ~/.bashrc
 echo 'export RMW_FASTRTPS_USE_SHM=0' >> ~/.bashrc
 source ~/.bashrc

 echo $RS2_USB_BACKEND

Here below result of what you asked me to check
image
image
Here below I turned on Pointcloud2 via Rviz2
image
And after that I see errors:
image

@MartyG-RealSense
Copy link
Collaborator

@denysderihlazov I went through your case again carefully from the beginning to analyze it again.

In your latest RViz image, I note that Fixed Frame has a red error stating that map does not exist.

Does anything appear in RViz if the Fixed Frame setting is changed from map to camera_link

@denysderihlazov
Copy link
Author

denysderihlazov commented Nov 15, 2024

@denysderihlazov I went through your case again carefully from the beginning to analyze it again.

In your latest RViz image, I note that Fixed Frame has a red error stating that map does not exist.

Does anything appear in RViz if the Fixed Frame setting is changed from map to camera_link

Hi:)
Sorry for not answering for long time. I'm currently on my last university year and I have lots things to do. This project is my Engineer project for diploma. I have everything done except working Intel Realsense D455 for my RTAB

I have only 1.5 month to make it working properly.

Actually I have tried this:

git clone https://github.com/IntelRealSense/realsense-ros.git -b ros2-master
cd ~/ros2_ws

sudo apt-get install python3-rosdep -y
sudo rosdep init # "sudo rosdep init --include-eol-distros" for Foxy and earlier
rosdep update # "sudo rosdep update --include-eol-distros" for Foxy and earlier
rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y
ROS_DISTRO=humble 
source /opt/ros/$ROS_DISTRO/setup.bash
. install/local_setup.bash
but the result is always the same
denys@ubuntu:~/ros2_ws$ ros2 launch realsense2_camera rs_launch.py
[INFO] [launch]: All log files can be found below /home/denys/.ros/log/2024-11-15-14-19-10-236436-ubuntu-10950
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [realsense2_camera_node-1]: process started with pid [10951]
[realsense2_camera_node-1] [INFO] [1731676750.859186212] [camera.camera]: RealSense ROS v4.55.1
[realsense2_camera_node-1] [INFO] [1731676750.859439897] [camera.camera]: Built with LibRealSense v2.55.1
[realsense2_camera_node-1] [INFO] [1731676750.859485053] [camera.camera]: Running with LibRealSense v2.55.1
[realsense2_camera_node-1] [WARN] [1731676750.875672390] [camera.camera]: No RealSense devices were found!
^Z
[1]+  Stopped                 ros2 launch realsense2_camera rs_launch.py
denys@ubuntu:~/ros2_ws$ ^C

I will probably start from the beginning. I have one more SSD NVMe
I'm gonna instal Jetpack 6 rev2 (the Jetpack version for Ubuntu 22.04.4)

If you have full list of what to install from like clean OS Ubuntu 22.04.4 to have SLAM/RTAB on Intel Realsense D455
List of commands one by one
Thank you in advance:)

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 15, 2024

An Nvidia guide published recently about using isaac_ros_visual_slam with a RealSense IMU-equipped camera (such as D455) may be a helpful reference.

https://nvidia-isaac-ros.github.io/concepts/visual_slam/cuvslam/tutorial_realsense.html

@denysderihlazov
Copy link
Author

denysderihlazov commented Nov 16, 2024

Hi MartyG-RealSense,

Thank you for pointing out the Nvidia guide. I have already reviewed it and attempted to follow its steps, but I am still encountering issues. I’ve tried multiple approaches and have been stuck for quite some time now.

Would it be possible for us to schedule a screensharing session to troubleshoot this problem together? I’m happy to compensate you for your time if needed.

If we manage to resolve the issue, I’d be glad to create a detailed tutorial to help others set up the RealSense D455 with Isaac ROS Visual SLAM on Jetson Orin NX, JetPack 6.0+, Ubuntu 22.04.4, and ROS2 Humble.

This is my uni diploma project and I have 1 month to finish it. I have Lidar, motors, power suply (totally everything except Intel Realsense D455 Slam/RTAB).

Please let me know if this works for you.

@MartyG-RealSense
Copy link
Collaborator

I am not able to engage in communication activities such as screen-sharing, remote control or live-chat and can only provide advice through comments on this support forum, unfortunately.


JetPack 6 has problems with IMU-equipped RealSense cameras because JP6 removed a function called hiddraw that RealSense IMU cameras (which are known as HID devices) make use of. These problems can manifest as no IMU data available or the camera not being detected at all.

Would it be possible for you to change Ubuntu 22.04 to 20.04 and use JetPack 5.1.3 instead of JP6? RealSense IMU cameras should be able to work with JP 5.1.3.


If you need to use 22.04 and JP6 then IMU support for JP6 on a USB cable connection can be added by installing the RealSense MIPI driver at the link below, though it is a complex installation process.

https://github.com/IntelRealSense/realsense_mipi_platform_driver

If you decide to try this, please use the driver's Issues forum to ask questions about installation.

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


An alternative backup plan you might be able to consider if the ROS2 approach does not work out is to switch to ROS1 and the RealSense ROS1 wrapper, as SLAM tends to be easier to implement in ROS1 than ROS2. Intel have a ROS1 / RTABMAP SLAM guide at the link below.

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

@denysderihlazov
Copy link
Author

denysderihlazov commented Nov 16, 2024

I am not able to engage in communication activities such as screen-sharing, remote control or live-chat and can only provide advice through comments on this support forum, unfortunately.

JetPack 6 has problems with IMU-equipped RealSense cameras because JP6 removed a function called hiddraw that RealSense IMU cameras (which are known as HID devices) make use of. These problems can manifest as no IMU data available or the camera not being detected at all.

Would it be possible for you to change Ubuntu 22.04 to 20.04 and use JetPack 5.1.3 instead of JP6? RealSense IMU cameras should be able to work with JP 5.1.3.

If you need to use 22.04 and JP6 then IMU support for JP6 on a USB cable connection can be added by installing the RealSense MIPI driver at the link below, though it is a complex installation process.

https://github.com/IntelRealSense/realsense_mipi_platform_driver

If you decide to try this, please use the driver's Issues forum to ask questions about installation.

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

An alternative backup plan you might be able to consider if the ROS2 approach does not work out is to switch to ROS1 and the RealSense ROS1 wrapper, as SLAM tends to be easier to implement in ROS1 than ROS2. Intel have a ROS1 / RTABMAP SLAM guide at the link below.

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

Thank you so much for your advice and insights.
I have already tried MIPI and I'm not sure will it work or not. Cause there are no step by step tutorials with how to make Intel Realsense D455 working with Jetpack 6+. My other scripts are based on Jetpack 6. So downgrade to JP 5+ could be a huge problem in the future.

Since I have two NVMe SSDs on my Jetson Orin NX, I’ll try installing JetPack 5.1.3 on one of them. This setup will limit me to using ROS 2 Galactic or ROS 2 Foxy.

I’m leaning towards ROS 2 Foxy, as its support ended in 2023, which might make it more stable than Galactic for my use case. However, I’m unsure which ROS 2 version would be the better choice for achieving SLAM/RTAB with the RealSense D455.

Would you happen to have a 100% reliable recommendation on which combination of JetPack and ROS to use to ensure the best stability and functionality for SLAM or RTAB? Ideally, I’d like to stay on ROS 2, as I’ve previously encountered issues trying to use ROS 1 with this camera.

This project is quite critical for me, as I’ve been stuck for over six months trying to solve this problem, and a working solution would mean a lot to me. Thank you in advance for any further guidance you can provide.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 16, 2024

I do not have a recommendation for a specific JP version other than 5.1.3. However, RealSense ROS2 users on this support forum who have attempted to implement SLAM have often used a combination of slam_toolbox and depthimage_to_laserscan instead of RTABMAP.

IntelRealSense/realsense-ros#3235 (comment) is a currently open case that is using these two tools with 22.04 and Humble and an IMU-equipped D435i camera.

Below is a link to the ROS2 Humble version of slam_toolbox.

https://github.com/SteveMacenski/slam_toolbox/tree/humble

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

3 participants